How to Upload a Project on GitHub
Advertisement
Ad
Upload Your Project to GitHub
This guide shows you how to push a local project to GitHub from scratch in a few minutes.
Step 1: Create a Repository on GitHub
Go to GitHub → click New → name your repo → Create repository. Don't add a README (we'll push existing code).
Step 2: Initialize Git Locally
cd your-project
git init
git add .
git commit -m "Initial commit"
Step 3: Connect to GitHub
git remote add origin https://github.com/USERNAME/REPO.git
git branch -M main
Step 4: Push
git push -u origin main
Refresh your GitHub page — your code is now online! 🎉
Step 5: Future Updates
git add .
git commit -m "Describe your change"
git push
Pro Tip: Add a .gitignore
# Don't upload these
node_modules/
.env
dist/
FAQs
Authentication failed — why?
GitHub no longer accepts passwords. Use a Personal Access Token or SSH key. More in our how-to guides.
How do I upload without command line?
Use GitHub Desktop or drag-and-drop files in the web "Add file" button.
