
How to Upload a Project on GitHub (Beginner Guide 2026)
Short answer: create an empty repository on GitHub, then either drag your files into the browser upload page or run git init, git add ., git commit, git remote add origin and git push from your project folder. The command line method is better for any project you will keep updating.
GitHub is one of the best platforms for storing code online, managing versions, and sharing projects with others. If you want to upload your project for backup, collaboration, or portfolio purposes, this guide explains everything in a simple and beginner-friendly way.
You can upload a project on GitHub using two methods โ GitHub website or Git commands. Let's go step by step.
Why Upload Your Project on GitHub?
Here are the major benefits of uploading your project:
- Keeps your code safe in the cloud
- Tracks every version or change
- Helps you collaborate with others
- Makes your project easy to share
- Useful for interviews and portfolios
- Works on all devices and operating systems
Prerequisites Before Uploading
Before starting, make sure you have:
- A GitHub account
- A complete project folder on your computer
- Git installed (only if using command line method)
Method 1 โ Upload Your Project Using GitHub Website
This method is easiest and perfect for beginners.
Step 1 โ Create a New Repository
- Log in to your GitHub account.
- Click on the "New Repository" button (+ icon in top right).
- Enter a repository name (example: my-project-app).
- Choose Public or Private.
- Click Create Repository.
Step 2 โ Upload Files
- After the repository is created, click Add File โ Upload Files.
- Drag and drop your project folder or select files manually.
- Add a commit message like "Initial upload".
- Click Commit Changes.
โ Your project is now uploaded successfully!
Step 3 โ Add README (Optional)
A README file helps people understand your project. You can explain:
- What the project does
- How to install
- How to use
- Features
- Technologies used
Method 2 โ Upload Project Using Git Commands
This method is preferred by developers and useful for large projects.
Step 1 โ Open Terminal and Initialize Git
Navigate to your project folder and run:
git initStep 2 โ Add Remote Repository URL
Copy your GitHub repository URL and run:
git remote add origin https://github.com/username/repo-name.gitStep 3 โ Add Files to Staging
git add .Step 4 โ Commit the Files
git commit -m "Initial commit"Step 5 โ Push Files to GitHub
git push -u origin mainQuick Command Summary
| Step | Command | Purpose |
|---|---|---|
| 1 | git init | Initialize Git in folder |
| 2 | git remote add origin URL | Connect to GitHub repo |
| 3 | git add . | Stage all files |
| 4 | git commit -m "message" | Save changes locally |
| 5 | git push -u origin main | Upload to GitHub |
Best Practices After Uploading
To keep your repository clean:
- Add a README with project details
- Use
.gitignoreto remove unwanted files - Make frequent commits
- Write clear commit messages
- Keep your repository organized
Uploading an existing project that already uses Git
If your project folder already has a .git folder (for example you have been committing locally), you do not need git init. Create an empty repository on GitHub without a README, licence or .gitignore, so there is nothing to conflict with, then connect and push:
git remote add origin https://github.com/your-name/your-repo.git
git branch -M main
git push -u origin main
If you did create the repository with a README, GitHub already has a commit your local copy does not know about, and the push is rejected. Run git pull origin main --allow-unrelated-histories, resolve any conflicts, then push again.
Signing in from the command line
GitHub no longer accepts your account password for Git operations over HTTPS. You have three common options. The easiest is the GitHub CLI: run gh auth login and follow the prompts, which also configures Git. Another is Git Credential Manager, included with Git for Windows, which opens a browser sign-in the first time you push. The third is a personal access token used in place of a password, or SSH keys, which many developers prefer because they never expire unexpectedly and work across all repositories.
Write a .gitignore before your first commit
A .gitignore file tells Git which files never to upload. Add it before the first git add so unwanted files never enter history:
node_modules/
dist/
.env
*.log
.DS_Store
GitHub offers ready-made templates for many languages when you create a repository, and you can find them in GitHub's public gitignore repository. If you have already pushed a secret such as an API key, deleting the file is not enough, because it stays in history. Revoke and replace the key immediately.
Common mistakes
- Uploading the
node_modulesfolder or other generated files, which makes the repository huge. - Pushing to
masterwhen the repository usesmain, or the other way round. Check withgit branch. - Running
git initin your home folder instead of the project folder, which tries to track every file on your computer. - Making a repository public before checking it for passwords, keys or personal data.
Learn the commands behind each step in Git basics, make your repository welcoming with README best practices, and publish a site from it with free website deployment.
FAQs โ Uploading Projects on GitHub
1. Is GitHub free to use?
Yes, GitHub is free for both public and private repositories.
2. Can I upload large files?
You can upload files up to standard size limits. Large files should be avoided in regular repositories.
3. Do I need to know Git commands?
No. You can upload using the website method without any commands.
4. Can I update my project later?
Yes. You can upload more files or push updated code anytime.
5. Can beginners use GitHub?
Absolutely. GitHub is designed for both beginners and advanced developers.
6. What are GitHub's file size limits?
Files added through the browser are limited to 25 MB each. With Git on the command line, GitHub warns about files larger than 50 MB and blocks files larger than 100 MB. Use Git Large File Storage (Git LFS) for big assets such as videos or datasets.
7. Can I make a private repository public later?
Yes. In the repository settings, the "Danger Zone" section lets you change visibility. Review the full commit history first, because everything in it becomes visible.
