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

  1. Install Git (git-scm.com) + choose good defaults (editor, line endings)
  2. Set name & email globally (user.name, user.email)
  3. Set default branch to main: git config –global init.defaultBranch main
  4. Create useful aliases (lg, st, co, br, etc.)
  5. Understand Git is local-first — GitHub is just a popular remote host
  6. 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

  1. status / diff / add / commit / log / show
  2. amend (–no-edit, -m, –author)
  3. reset (soft / mixed / hard) + HEAD~n syntax
  4. checkout / switch / restore (file vs branch)
  5. stash (push / pop / list / drop / apply)
  6. 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

  1. branch / switch / checkout -b
  2. merge (fast-forward vs true merge commit)
  3. merge conflict resolution (markers, add, commit)
  4. rebase (basic + conflict resolution)
  5. rebase vs merge — when to choose what
  6. interactive rebase (-i): squash / fixup / reword / edit / drop
  7. 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

  1. remote add / set-url / rename / remove
  2. push / pull / fetch / fetch –prune
  3. push -u (upstream tracking)
  4. push –force-with-lease (safe force)
  5. origin + upstream pattern (fork workflow)
  6. pull –rebase vs pull (merge)
  7. pull.rebase = true global config
  8. 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

  1. .gitignore (global + per-repo + negation !)
  2. .gitattributes (eol=lf/crlf, text/binary, diff drivers)
  3. Git LFS (track large files, migrate existing)
  4. pre-commit hooks (Husky / lefthook) – lint, test, secrets scan
  5. commit-msg hook – Conventional Commits enforcement
  6. pre-push hook – block direct push to main
  7. 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

  1. reflog (time machine) – recover after reset / rebase / amend
  2. revert (safe undo for pushed commits)
  3. reset (soft/mixed/hard) – local cleanup
  4. rebase -i advanced (split commit, exec shell commands)
  5. filter-repo / BFG Repo-Cleaner (remove secrets / large files from history)
  6. 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

  1. GitHub Flow (main + short-lived feature branches + PRs)
  2. Trunk-based development (very short branches + feature flags)
  3. Git Flow legacy (develop/release/hotfix) – when still used
  4. Protected branches + required PR reviews + status checks
  5. Signed commits + branch protection rules
  6. GitHub Actions CI/CD basics (lint + test + deploy)
  7. 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)

  1. git worktree (multiple branches checked out simultaneously)
  2. git bundle / git archive (offline sharing)
  3. git format-patch / git am (email-style patch exchange)
  4. git submodule / git subtree (nested repos)
  5. 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! 🚀

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *