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:
- A GitHub account: https://github.com
- Git installed on Windows: Download Git
- A project folder with files you’d like to upload
Step 1: Install Git on Windows
If Git isn’t already installed:
- Download the Git installer for Windows.
- Run the installer with default settings.
- 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
- Log in to your GitHub account.
- Click the “+” icon in the top right and select “New repository.”
- Fill in the repository details (name, description, visibility).
- 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
- Open Git Bash or Command Prompt.
- Navigate to your project directory:
cd path\to\your\project
- 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
withmain
.
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:
- Go to your GitHub repository page.
- Click “Add file” > “Upload files”.
- Drag and drop files or select them from your computer.
- 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:
- Install Git
- Create a GitHub repo
- Initialize Git locally
- Add and commit files
- Connect to the remote repo
- Push to GitHub
Mastering this workflow will streamline your development process, enable version control, and facilitate collaboration with others.