How to Upload Files to GitHub from Windows: A Step-by-Step Guide

Whether you’re a developer, designer, or data analyst, GitHub is a powerful platform for version control and collaboration. If you’re working on Windows and want to upload your project files to GitHub, this guide walks you through the process—from creating a repository to pushing your changes using Git.

This tutorial assumes you’re working with Git locally on your Windows machine.


Prerequisites

Before you start, ensure you have the following:


Step 1: Install Git on Windows

If Git isn’t already installed:

  1. Download the Git installer for Windows.
  2. Run the installer with default settings.
  3. After installation, verify Git is available:
git --version

You can now use Git from Git Bash, Command Prompt, or PowerShell.


Step 2: Create a Repository on GitHub

  1. Log in to your GitHub account.
  2. Click the “+” icon in the top right and select “New repository.”
  3. Fill in the repository details (name, description, visibility).
  4. Click Create repository.

You’ll be presented with instructions to connect your local project to the remote repository—keep this page open.


Step 3: Initialize Git in Your Project Folder

  1. Open Git Bash or Command Prompt.
  2. Navigate to your project directory:
cd path\to\your\project
  1. Initialize the Git repository:
git init

Step 4: Add and Commit Files

Tell Git to start tracking your files and commit them:

git add .
git commit -m "Initial commit"
  • git add . stages all files in the directory.
  • git commit records the snapshot of the files.

Step 5: Connect to the Remote Repository

Copy the repository URL from GitHub. It will look like:

  • HTTPS: https://github.com/your-username/your-repo.git
  • SSH: gi*@gi****.com:your-username/your-repo.git

Then connect your local repo to the GitHub repo:

git remote add origin https://github.com/your-username/your-repo.git

Step 6: Push Your Files to GitHub

Now, push your local commits to GitHub:

git push -u origin master

⚠️ If you’re using GitHub’s newer naming convention, replace master with main.

If prompted, enter your GitHub credentials. Consider enabling Git Credential Manager or using SSH for secure access.


Alternative: Upload via GitHub Web Interface

If you’re not comfortable using Git yet:

  1. Go to your GitHub repository page.
  2. Click “Add file” > “Upload files”.
  3. Drag and drop files or select them from your computer.
  4. Click Commit changes to finish.

This is quick for small uploads or one-time changes but not suitable for ongoing development.


Summary

Uploading files to GitHub from Windows is straightforward once you understand the steps:

  1. Install Git
  2. Create a GitHub repo
  3. Initialize Git locally
  4. Add and commit files
  5. Connect to the remote repo
  6. Push to GitHub

Mastering this workflow will streamline your development process, enable version control, and facilitate collaboration with others.

Sharing Is Caring:

Leave a Comment