Watch · Chapter 5

Git as Agent Infrastructure

2:30 · Part II: Rigging the Ship

Made by AI agents — script drafted from the book, AI narration, animation written as code — and steered by the author, Rasmus Bornhøft Schlünsen.

Transcript

What the film says

An agent can change twenty files in thirty seconds. Bundle them into one commit, and when something breaks, you're untangling a mess. Split them into five clean commits, and you revert the one that broke and keep the rest. With agents, Git stops being just version control. It becomes the backbone: your undo button, your parallel workspace, your review screen, and your documentation.

The first habit: commit small, and commit often. Commit after each logical change, after the tests pass, and before anything risky, so there's always a save point to return to.

Then let the agent write the commit message. It has the whole diff in context, so it summarizes from facts, not memory. Fix auth bug is noise. A message that explains the race condition, and why it happened, is useful six months later. Add a co-author line, so agent work is searchable. Your name is still on the commit.

Every agent task gets its own branch. That gives you isolation, a clear review scope, and a clean rollback: if it's wrong, delete the branch. Name branches after the task, and your branch list becomes a manifest of what your agents are doing.

For agents working in parallel, branches aren't enough. Two agents in one folder will fight over the files. A worktree gives each agent its own directory on its own branch, sharing one history. It's the cheapest sandbox there is. Just remember it holds only what Git tracks, so no environment files, and no installed dependencies.

More and more, tools create worktrees for you, and cloud agents clone the repo into a remote sandbox and hand back a pull request. The shape is the same every time: an isolated copy, a dedicated branch, and a diff you review.

Your review interface is the diff. Read the tests first, watch for scope creep, and check the interfaces. When agents run in parallel, reviewing becomes the bottleneck. Keep pull requests small, let C I and linters take the first pass, and don't start what you can't review this week.

Finally, agents read your history. Git log and git blame are documentation they consult directly. A history of fix bug leaves them guessing. Every commit message, branch name and pull request is context for the next agent, so make it worth reading. Next up: testing as the feedback loop.