Is it even possible to be a real-world developer without Git? Absolutely not.
In this post, I’ll guide you from zero to pro with Git — including installation, terminal usage, VS Code integration, and both basic & advanced commands.
🔧 ১. Git Installation & Local Setup
✅ Step 1: Install Git
Windows: https://git-scm.com/download/win
Mac: Use Homebrew
brew install git
Linux:
sudo apt install git
✅ Step 2: Git Global Config
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
✅ Step 3: Add SSH Key (for GitHub/GitLab)
ssh-keygen -t ed25519 -C "youremail@example.com"
Then copy your public SSH key and add it to your GitHub/GitLab SSH settings.
📁 ২. Initial Project Setup & First Commit
🔹 Git Init
git init
🔹 File Stage & Commit
git add .
git commit -m "Initial commit"
🔹 Remote Add & Push
git remote add origin https://github.com/yourname/your-repo.git
git push -u origin main
🧪 ৩. Daily Workflow with Git (Pull, Push, Branching)
🔹 Clone
git clone https://github.com/yourname/project.git
🔹 Pull
git pull origin main
🔹 Branch Create & Switch
git checkout -b feature-x
🔹 Merge
git checkout main
git merge feature-x
🧠 ৪. Advanced Git Commands
🔹 Stash & Pop
git stash
git stash pop
🔹 Rebase
git checkout feature
git rebase main
🔹 Cherry-pick
git cherry-pick <commit-id>
🔹 Reset to Previous Commit
git reset --hard HEAD~1
💣 ৫. Common Mistakes & Fixes
Merge Conflict? Don’t panic. Fix the conflict markers, commit, and continue.
Detached HEAD? Switch back to a branch:
git switch main
- Pulled wrong changes? Use
git reflog
to recover lost commits.
🚀 Bonus Tools
🧾 Cheat Sheet
📎 Download PDF: Git Cheat Sheet PDF
🙌 Connect With Me
🔗 GitHub: @masaudahmod
💬 Leave a comment if you want a Git crash course in video format
🌟 Follow me for more content on Git, React, Firebase, and MERN stack development
Top comments (0)