Module 3 — Version control in depth
Estimated: 1 week · Syllabus · ← Module 2 · Next → Module 4
Concepts
Section titled “Concepts”- Git’s model, not just its commands. Git is a content-addressed DAG of commits; a branch is a movable pointer, HEAD is where you are, merge creates a commit with two parents, rebase replays commits onto a new base. Understanding the graph makes every command obvious. Most Git confusion is confusion about the graph.
- Commit hygiene. Atomic commits (one logical change each). Messages explain why; the diff shows what. A good message: short imperative summary, blank line, body with rationale.
- Conventional Commits.
feat:,fix:,refactor:,test:,docs:,chore:— structured prefixes that enable automated changelogs and communicate intent at a glance. - Branching strategies. Trunk-based (short-lived branches, merge fast) vs. Git Flow (heavier, release-oriented). For solo/small work, trunk-based avoids long divergence and merge pain. The theoretical tradeoff: integration frequency vs. isolation.
- Merge vs. rebase. Merge preserves true history (and creates merge commits); rebase produces linear history (by rewriting commits). Rule: rebase your own unpushed work to tidy it; never rewrite shared history.
- Semantic versioning.
MAJOR.MINOR.PATCH— a contract with consumers about what a version bump means. Tag releases. - The
.gitignorediscipline and why generated/secret/local files never get committed.
CS theory dive
Section titled “CS theory dive”Read the “Git Internals” chapter of Pro Git (blobs, trees, commits, refs). Once you see that commits are immutable snapshots keyed by hash and branches are just refs, rebasing and cherry-picking stop being scary.
Practice
Section titled “Practice”On Project B (FeeForge): adopt Conventional Commits, work in short-lived feature branches
(e.g. feat/fee-engine, feat/proposal-crud), practice an interactive rebase to clean up a
messy local branch before merging, and tag v0.1.0. Deliberately create and resolve a merge
conflict so it’s not mysterious. Note the distinction between code versioning (Git) and
data versioning (Prisma/Drizzle migrations) — both are version control, and you’ll start the
migration history here.
Environment note: interactive Git (
git rebase -i,git add -i) does not work inside a Claude Code session — no interactive editor. Run those in your own terminal, or use non-interactive equivalents (git rebase --onto,git commit --fixup+--autosquash).
Milestone
Section titled “Milestone”☐ A clean, readable git log telling the story of the project’s growth, plus one tagged
release.
(working notes go here)