Chapter 56: Git Study Plan
Git Study Plan – 6 Weeks to “I’m confident in interviews & daily work”
Total time commitment ≈ 60–90 minutes / day, 5–6 days/week (Realistic for people who have jobs / college)
Core philosophy of this plan
- 70% hands-on typing in terminal
- 20% reading good documentation / watching short videos
- 10% explaining concepts out loud / writing notes / teaching imaginary friend
- Deliberate practice of painful scenarios (conflicts, resets, recovery)
Week 0 – Setup & First Mindset (2–4 days)
Goal: Remove fear, install good defaults, build confidence
Day 0 – Install & configure (30–60 min)
- Download Git → https://git-scm.com/downloads
- Windows → choose “Use Git from Git Bash and Command Prompt” during install
- macOS/Linux → already there or brew install git / sudo apt install git
- Set identity (appears on every commit)
|
0 1 2 3 4 5 6 7 |
git config --global user.name "Your Full Name" git config --global user.email "your-real-github-email@gmail.com" |
- Modern defaults (2026 must-have)
|
0 1 2 3 4 5 6 7 8 9 10 |
git config --global init.defaultBranch main git config --global core.editor "code --wait" # VS Code (or nano/vim) git config --global core.autocrlf input # Linux/macOS # or git config --global core.autocrlf true # Windows git config --global pull.rebase true # pull = fetch + rebase (clean history) |
- Create pretty log alias (you will use this 50 times a day)
|
0 1 2 3 4 5 6 |
git config --global alias.lg "log --graph --oneline --decorate --all" |
Day 1 – First repo + muscle memory (60 min)
Create folder → git init → add file → commit → amend → reset –mixed → reflog recover
Repeat 5–8 times until you can do the whole cycle in < 90 seconds without looking notes.
Day 2 – Read these three short pages (must-read)
- https://git-scm.com/book/en/v2/Getting-Started-Git-Basics
- https://github.com/git-guides
- https://ohmygit.org/ (play the game 2–3 levels)
Week 1 – Survival Kit (Daily 60–90 min)
Goal: Never feel lost when alone with Git
Topics & Exercises
- status / diff / add / commit / log / show / restore
- amend (message + forgot file)
- reset soft/mixed/hard + HEAD~n
- checkout / switch / restore (file vs branch)
- stash push/pop/list/apply/drop
- reflog (recover after reset –hard / bad rebase)
Daily drill (repeat 15–25 times)
- Make 3–5 changes
- Stage partially (git add -p)
- Commit → amend → forget file → amend again
- reset –mixed HEAD~1 → re-commit better
- reset –hard → panic → reflog → recover
- stash messy changes → switch branch → pop
End of week checkpoint Can you recover from git reset –hard HEAD~3 in under 60 seconds? If yes → move to week 2. If no → repeat 2 more days.
Week 2 – Branching & History (Daily 60–90 min)
Goal: Feel safe doing parallel work + clean history
Topics & Exercises
- branch / switch / checkout -b
- merge (fast-forward vs true merge commit)
- merge conflict resolution (markers, add, commit)
- rebase basic + conflict resolution
- rebase vs merge — when to choose what
- interactive rebase (-i): squash / fixup / reword / edit / drop
- cherry-pick (single commit transplant)
Daily drill
- Create feature branch → 5 messy commits
- rebase -i → squash into 1–2 clean commits
- merge to main → delete branch
- Create conflict on purpose → resolve in VS Code
- Cherry-pick one commit from another branch
End of week checkpoint Can you clean 6 messy commits into 2 nice ones with rebase -i in < 4 minutes? Can you resolve a 3-file conflict without panic? If yes → week 3.
Week 3 – Remote + GitHub Reality (Daily 60–90 min)
Goal: Work with GitHub like a professional
Topics & Exercises
- remote add / set-url / rename / remove
- push / pull / fetch / fetch –prune
- push -u (upstream tracking)
- push –force-with-lease
- origin + upstream pattern (fork workflow)
- pull –rebase vs pull (merge)
- Protected branches + required PR reviews (simulate on your repo)
Daily drill
- Fork any beginner-friendly repo (public-apis, freeCodeCamp, etc.)
- Clone your fork → add upstream → sync main
- Create feature branch → push → create PR → simulate review → merge
- Practice force-with-lease after rebase
End of week checkpoint You can do the full “fork → sync → branch → PR → merge” cycle in < 10 minutes.
Week 4 – Quality & Safety Layers (Daily 60–90 min)
Goal: Never commit garbage again
Topics & Exercises
- .gitignore (global + per-repo + negation !)
- .gitattributes (eol=lf/crlf, text/binary)
- Git LFS (track large files, migrate existing)
- pre-commit hooks (Husky / lefthook) – lint, test, secrets scan
- commit-msg hook – Conventional Commits
- Signed commits (GPG / SSH) – verified badge
Daily drill
- Create .gitignore for your stack (Node, Python, Java…)
- Add .gitattributes → test LF/CRLF behavior
- Set up Husky → pre-commit runs ESLint + Prettier + no-secrets
- Sign one commit → check green “Verified” on GitHub
Week 5–6 – Advanced Surgery & Recovery (Daily 45–90 min)
Goal: Fearless history rewriting
Topics & Exercises
- reflog recovery (after reset / rebase / amend)
- revert (safe undo for pushed commits)
- reset (soft/mixed/hard) – local cleanup
- rebase -i advanced (split commit, exec shell)
- filter-repo / BFG (remove secrets / large files from history)
- git bisect (find bug commit)
- git worktree (multiple branches checked out)
Daily drill
- Intentionally break history 3 ways → recover with reflog every time
- Rebase -i to split one commit into two
- Use filter-repo to remove fake secret from history
- git bisect on a small repo to find “when bug started”
Week 7+ – Real-World Application & Contribution
Goal: Apply in real life
- Contribute to 3–5 real open-source repos (typo → docs → small feature)
- Set up GitHub Actions CI for your personal project
- Simulate team workflow (PR reviews, merge conflicts, rebase before PR)
- Teach Git to a friend / junior — explaining = deepest learning
Final Recommended Tools Stack (2026)
- Terminal + aliases (must)
- VS Code Git panel (very good built-in)
- GitHub Desktop / GitKraken / Fork (visual graph & conflict resolver)
- Husky / lefthook (hooks)
- git-filter-repo (history cleanup)
- git-lfs (large files)
7-Day Challenge Suggestion (if you want to start right now)
Day 1 – Setup + 20× basic commit cycle + amend Day 2 – Branch → merge → conflict resolution (3×) Day 3 – Rebase basic + rebase -i (squash 6 → 2 commits) Day 4 – Reset soft/mixed/hard → reflog recover (5×) Day 5 – Fork → upstream → sync → PR cycle (2×) Day 6 – .gitignore + .gitattributes + Husky pre-commit Day 7 – Cherry-pick + revert + bisect small exercise
Which day / phase do you want to start with right now? Or want me to give you a personalized 7-day plan based on what you feel weakest at?
Tell me — we’ll keep going until you feel completely confident. You’ve already come incredibly far — let’s make sure it sticks forever. 🚀
