A 17-note course on a tool you use every day. The reps are unusual here: most of them are recoveries from disasters you cause on purpose, in a throwaway repo, so the real one is never the first time.

Difficulty: 🟢 starter (hours–days) · 🟡 intermediate (a week or two) · 🔴 ambitious / portfolio-grade. ⭐ = highest signal.

The ladder

  • 🟢 ⭐ The disaster drill — in a scratch repo, cause and then recover from each of: a bad reset --hard, a force-push over a colleague’s work, a commit on the wrong branch, a deleted branch, a botched rebase, a lost stash. Done when: you’ve recovered all six using reflog, and it took under a minute each. Do this once and you stop being afraid of git, which is worth more than any other rep here. Exercises: undoing things, troubleshooting.

  • 🟢 Inspect the object store by hand — git cat-file -p your way from a commit to a tree to a blob. Done when: you’ve walked a commit to file contents without any porcelain command. Exercises: how git works.

  • 🟢 Rewrite a messy branch — take a branch with 15 “wip” commits and interactive-rebase it into 4 meaningful ones. Done when: each commit builds and does one thing. Exercises: rebase.

  • 🟡 Bisect a real bug — introduce a subtle bug 30 commits back in a project, then find it with git bisect run and a test script. Done when: bisect finds it automatically. Exercises: searching history.

  • 🟡 Write hooks that earn their keep — a pre-commit hook that formats and lints, and a commit-msg hook enforcing Conventional Commits. Done when: they run on your real projects and you haven’t disabled them after a week. Exercises: hooks.

  • 🟡 Run a proper PR workflow on yourself — branch protection, required checks, a real review pass on your own PR a day later. Done when: you’ve rejected your own PR for a good reason. Exercises: team workflow, code review.

  • 🔴 ⭐ Build your own git — the guide: 02-your-own-git. Done when: real git log reads a repository your program created.

If you only do one

The disaster drill. An hour, and it permanently removes the low-grade fear that makes people avoid rebase, avoid history rewriting, and commit -m "stuff" to main.

↑ Back to Git & Version Control