#Tell Git who you are (so your commits have your name!)
git config --global user.name "John Doe"
git config --global user.email "john@example.com"
mkdir my-awesome-project # Create project folder
cd my-awesome-project # Go inside
git init # 🐣 Initialize Git repo (creates hidden .git folder)
You now have a local repository! 🎉
git status # 🔍 See what's changed (red = unstaged, green = staged)
git add . # Stage ALL changes (or git add filename for specific files)
git status # Now everything is green and ready!
git commit -m "Add landing page with cool animation" # Save snapshot
Best commit message style:
Present tense
Short (under 50 chars)
Example: "Add user authentication" | "Fix navbar bug on mobile"
Go to GitHub → New Repository → Name it → Create (DON’T initialize with README)
Copy the repo URL
git remote add origin https://github.com/username/my-awesome-project.git
git branch -M main # Rename default branch to main (modern standard)
git push -u origin main # First push! 🚀 (-u sets upstream tracking)
Now your code lives safely on GitHub!
#After making changes
git add .
git commit -m "Your meaningful message"
git push # Simple push (because of -u earlier)
git pull # Grab latest changes from GitHub
git fetch # Check what’s new without merging