Version Control and Collaboration
Git and GitHub fundamentals, and the extra discipline a diff needs when an AI agent wrote it instead of you.
Version Control and Collaboration
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Git tracks changes as a history of commits, and a branch is just a movable pointer into that history, which is what makes it safe to try something without touching working code.
- A pull request is a proposed merge plus a place to discuss it, not a formality — it's the checkpoint where a second set of eyes sees the diff before it lands.
- A commit message should describe intent ("why" this change exists), not just restate the diff or say "AI changes" — the message is what future-you reads when the code itself doesn't explain the decision.
- When an agent wrote a chunk of a diff, you still own it the moment you commit it — review it exactly as hard as you would a stranger's pull request, because your name goes on it either way.
- Small, frequent commits make both human and AI-generated changes easier to review, bisect, and revert than one sprawling commit that mixes five unrelated edits.
Commits are a history, not a save button
Git’s core idea is simple once it clicks: every commit is a snapshot of the whole project at a point in time, linked to the snapshot before it. That chain is the project’s history. A commit isn’t “saving” in the way a text editor saves — it’s you declaring “this is a coherent, intentional state of the code,” with a message explaining why it exists. Small commits that each do one thing make that history actually useful later, when you need to find which change introduced a bug or want to revert just one piece of work without touching everything else.
Branches make experimentation cheap
A branch is nothing more than a pointer to a commit that moves forward as you add new commits on top of it. Because of that, creating a branch costs almost nothing — you’re not copying files, you’re just giving yourself a new place to commit without disturbing main. This is what makes it safe to try a risky refactor, a new feature, or an agent-driven rewrite in isolation: if it doesn’t work out, you delete the branch and nothing else was ever at risk. Merging folds that branch’s commits back into another branch once the work is ready.
Pull requests are a review checkpoint, not paperwork
A pull request bundles a branch’s commits into a single proposed change and gives you a place to look at the full diff before it merges — comments, line-by-line discussion, and a clear “approve” or “request changes” moment. Treat that checkpoint as load-bearing even when you’re the only person on the project. The value isn’t the approval button; it’s being forced to read your own diff as a reviewer would, one more time, before it becomes permanent.
What changes when an agent writes the diff
Directing a coding agent doesn’t remove you from the authorship chain — it just moves where your judgment gets applied. You’re no longer deciding every keystroke, but you are still deciding what gets committed, and that decision is exactly as consequential as it was when you typed the code yourself. The habit that breaks first is reviewing the diff properly: it’s tempting to skim a large AI-generated change and commit it because it “looks right” and the tests pass. Read it the way you’d read a stranger’s pull request — because structurally, that’s what it is. You didn’t write it; someone (something) else did, and you’re the one vouching for it now.
Writing commit messages that survive the agent era
“AI changes” or “updated files” are commit messages that describe nothing a future reader couldn’t already see in the diff. A good message says what problem the change solves and why this approach, which matters more, not less, when the code came from a prompt rather than your own reasoning — because you’re often the only record of what you actually asked for and why you accepted the result. “Add retry logic to the payment webhook handler; previous version silently dropped failed deliveries” tells a future maintainer everything the raw diff can’t. That discipline is what keeps a commit history useful as a growing share of the commits in it come from directing a tool rather than typing by hand.
Check yourself
What does a branch actually represent in Git?
A branch is a lightweight, movable pointer to a particular commit — not a copy of the codebase — which is why creating and switching branches is fast and cheap.
Why does a commit message matter more, not less, when an AI agent generated the change?
The diff already shows what changed; the message is the only place that records why the change was made and what judgment went into accepting it. "AI changes" throws that information away.
What should you do differently before committing a diff an agent produced, compared to code you typed yourself?
Nothing structurally different — read the whole diff line by line, check it does what you intended and nothing extra, exactly as you would review a colleague's pull request, before letting it become part of the project's history.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.