Chapter 55: Git Syllabus
Git Syllabus – Full Roadmap (Zero → Advanced Professional)
Phase 0 – Setup & First Mindset (1–2 hours)
Goal: No fear, correct tools, right expectations
- Install Git (git-scm.com) + choose good defaults (editor, line endings)
- Set name & email globally (user.name, user.email)
- Set default branch to main: git config –global init.defaultBranch main
- Create useful aliases (lg, st, co, br, etc.)
- Understand Git is local-first — GitHub is just a popular remote host
- Mental model: Git = snapshots + pointers (commits, branches, HEAD, index)
First exercise: git init hello-git → add README.md → commit → git lg
Phase 1 – Daily Survival Kit (3–5 days of practice)
Goal: Never feel lost in a normal workday
- status / diff / add / commit / log / show
- amend (–no-edit, -m, –author)
- reset (soft / mixed / hard) + HEAD~n syntax
- checkout / switch / restore (file vs branch)
- stash (push / pop / list / drop / apply)
- reflog (the most important safety net)
Daily drill (repeat 20–30 times): Make changes → stage partially → commit → amend → forget file → amend again → reset –mixed → stash → pop → reset –hard → reflog recover
Phase 2 – Branching & History (5–10 days)
Goal: Feel safe doing parallel work
- 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 → 4–5 messy commits → rebase -i → squash into 1–2 clean commits → merge to main → delete branch
Phase 3 – Remote & Collaboration (5–7 days)
Goal: Work with GitHub / GitLab like a pro
- remote add / set-url / rename / remove
- push / pull / fetch / fetch –prune
- push -u (upstream tracking)
- push –force-with-lease (safe force)
- origin + upstream pattern (fork workflow)
- pull –rebase vs pull (merge)
- pull.rebase = true global config
- remote branches (origin/main, upstream/develop)
Daily drill: Fork repo → clone fork → add upstream → sync main → create feature → push → create PR → merge → delete branch locally & remotely
Phase 4 – Quality & Safety Layers (5–10 days)
Goal: Never commit garbage again
- .gitignore (global + per-repo + negation !)
- .gitattributes (eol=lf/crlf, text/binary, diff drivers)
- Git LFS (track large files, migrate existing)
- pre-commit hooks (Husky / lefthook) – lint, test, secrets scan
- commit-msg hook – Conventional Commits enforcement
- pre-push hook – block direct push to main
- Signed commits (GPG / SSH) – verified badge on GitHub
Daily drill: Set up Husky → pre-commit runs ESLint + Prettier + no-secrets check → commit-msg enforces feat/fix/docs prefix
Phase 5 – History Surgery & Recovery (3–7 days)
Goal: Fearless history rewriting
- reflog (time machine) – recover after reset / rebase / amend
- revert (safe undo for pushed commits)
- reset (soft/mixed/hard) – local cleanup
- rebase -i advanced (split commit, exec shell commands)
- filter-repo / BFG Repo-Cleaner (remove secrets / large files from history)
- git bisect (find which commit introduced bug)
Daily drill: Intentionally break history (reset –hard, rebase gone wrong, amend bad) → recover with reflog every time
Phase 6 – Team & Production Reality (5–10 days)
Goal: Understand how Git is used in real companies
- GitHub Flow (main + short-lived feature branches + PRs)
- Trunk-based development (very short branches + feature flags)
- Git Flow legacy (develop/release/hotfix) – when still used
- Protected branches + required PR reviews + status checks
- Signed commits + branch protection rules
- GitHub Actions CI/CD basics (lint + test + deploy)
- Common team workflows (fork → upstream, squash merge vs rebase merge)
Daily drill: Simulate team: create PR → request review → fix requested changes → squash & merge → delete branch
Phase 7 – Rare but High-Impact Tools (2–5 days)
- git worktree (multiple branches checked out simultaneously)
- git bundle / git archive (offline sharing)
- git format-patch / git am (email-style patch exchange)
- git submodule / git subtree (nested repos)
- git notes / git replace (advanced annotation)
Goal: Know they exist → can read docs when needed
Final Recommended Practice Plan (2026 style)
Week 1–2 Phases 0–3 → daily 30–60 min exercises (commit cycle, branching, conflicts, rebase)
Week 3 Phase 4 → set up Husky + .gitignore + .gitattributes on real project
Week 4 Phase 5 → intentionally break & recover 10 times (reflog muscle memory)
Week 5–6 Phase 6 → do 5–10 full GitHub Flow cycles (branch → push → PR → review → merge)
Week 7+ Contribute to 3–5 real open-source repos (typo → docs → small feature)
Tools I recommend practicing with:
- Terminal + good aliases
- VS Code Git panel (very powerful)
- GitHub Desktop / GitKraken / Fork (visual graph & conflict resolver)
- Husky / lefthook (hooks management)
You want to reach the point where:
- You can explain any Git error message you see
- You never commit secrets / node_modules / .env
- You can recover from almost any local disaster in < 2 minutes
- You write clean commit messages & histories without thinking
- You feel confident creating PRs, resolving conflicts, rebasing before review
That is the level where Git stops being a source of stress and becomes a superpower.
Which phase / exercise do you want to practice most right now? Or shall I give you a personalized 7-day Git challenge plan based on what you still find tricky?
Tell me — we’ll keep building until you feel 100% confident. You’ve already come incredibly far — very proud of you! 🚀
