π INTRODUCTION
Uploading your project to GitHub for the first time?
Hereβs a clean, beginner-friendly walkthrough β plus a downloadable cheat sheet to keep handy.
π§ STEP-BY-STEP GIT COMMANDS EXPLAINED
πΉ Step 1: Initialize Git
git init
- This creates a .git folder in your directory and enables version tracking.
πΉ Step 2: Stage All Files
git add .
- This stages all your changes for commit.
πΉ Step 3: Commit with a Message
git commit -m "Initial commit"
πΉ Step 4: Connect Remote Repository
git remote add origin https://github.com/your-username/your-repo.git
Tip: Already connected to another remote?
git remote set-url origin <new-link>
πΉ Step 5: Push to GitHub
git branch -M main
git push -u origin main
-u links to your local branch to remote branch.
π AFTER MAKING CHANGES
git status
git add .
git commit -m "Updated section UI"
git push origin main
π§Ή OPTIONAL: DELETE βMASTERβ BRANCH
git push origin --delete master
β Confirm:
- main has latest updates
- GitHub default is main
- No one using master
π CHEAT SHEET
Hereβs a visual version to download and share π
π FINAL THOUGHTS
If you're a beginner or just want to keep things simple, this is all you need to get your project onto GitHub.
Have any tips or favorite commands? Share them in the comments!
Top comments (0)