Skip to content

Quiz: Version Control as a Safety Net

Test your understanding of commits, diffs, branches, pull requests, reverts and branch hygiene with these review questions.


1. What is a save point?

  1. A backup of the live database taken every night
  2. A branch that holds the trusted version of the code
  3. A commit made at a moment when the app works, so you can return to that state later
  4. A setting that makes the agent save files more often
Show Answer

The correct answer is C. A save point is a commit made while the app works. It is the campfire before the cave: commit before any risky request, and if the agent breaks something you can return to exactly that state. Option A confuses code with data, and Git protects code, not database rows. Option B describes the main branch. Option D isn't a Git idea.

Concept Tested: Save Point

See: Commits Are Save Points


2. What does it mean to revert a commit?

  1. To add a new commit that does the exact opposite of an earlier one, keeping both in the history
  2. To delete an earlier commit from the history as if it never happened
  3. To move the branch back to an older commit and drop everything after it
  4. To copy a commit from GitHub back to your laptop
Show Answer

The correct answer is A. A revert adds an opposite commit, so the change is undone and the history records both. It leaves every later commit in place and is safe on a shared main. Options B and C describe history-rewriting moves such as git reset --hard, which can throw away good work and should be treated as one-way doors. Option D describes a pull.

Concept Tested: Revert a Commit

See: Reverting a Commit


3. Why is "ask the agent to undo it" a weak way to recover when the agent breaks the sign-in page?

  1. Agents are not allowed to edit sign-in code
  2. The agent's memory of what it changed is only as good as its context window, which can drift or run out
  3. Undo requests cost more tokens than new features
  4. Git blocks agents from changing files twice in one session
Show Answer

The correct answer is B. An agent rebuilds "how it was" from its context, and Chapter 4 showed that context can drift or be cut. It may restore something close but not the same. A commit records the exact earlier state, so returning to it doesn't depend on anyone's memory. The other options are not limits that agents or Git have.

Concept Tested: Version Control

See: Version Control, Git and the Repository


4. Why is making a repository public treated as a one-way door?

  1. GitHub charges a fee to make it private again
  2. Public repositories can't have branches
  3. Public repositories lose their history
  4. Flipping it back to private doesn't recall copies already downloaded, forked or indexed
Show Answer

The correct answer is D. Once a repository is public, anyone can clone it, fork it, or have it indexed. Making it private again stops new readers but can't pull back what has already been copied, including any secret in the history. That's why private is the default. GitHub doesn't charge to flip it back, and public repositories keep their branches and history.

Concept Tested: Private Repository

See: Private Repositories


5. A scheduler diff changes eq(reminders.id, reminder.id) to lte(reminders.id, reminder.id). What does this one-word change do?

  1. One send marks every reminder with an ID up to this one as sent, not just this reminder
  2. The job now runs less often
  3. Nothing changes, since both words mean the same thing
  4. The reminder is now sent twice
Show Answer

The correct answer is A. eq means "equal to," so the old line marked one reminder as sent. lte means "less than or equal to," so the new line marks this reminder and every earlier one as sent, even if they never went out. The dating-safety app had a bug of this exact shape. It shows why reading even a one-line diff matters: the change is tiny and the effect is wide.

Concept Tested: Diff

See: Diffs: Seeing What Changed


6. Why does working in small steps make review easier?

  1. Small steps let the agent skip running tests
  2. Small steps produce fewer commits to keep track of
  3. A twenty-line change can be read in two minutes, while a nine-hundred-line change can't be read with care
  4. Small steps prevent merge conflicts entirely
Show Answer

The correct answer is C. A small commit is easy to read, easy to undo on its own, and easy to blame when a bug appears. A huge one hides risky changes among harmless ones. Small steps produce more commits, not fewer (B), and they still need tests (A). They make conflicts rarer but don't prevent them all (D).

Concept Tested: Small Steps

See: Small Steps


7. You asked the agent to add a "not checked" label on the results page. The diff lists ResultsPage.tsx, CheckList.tsx, package.json and scoring.ts. What should you do first?

  1. Accept it, since the label works on screen
  2. Ask the agent to write a longer commit message
  3. Delete the branch and start over
  4. Ask why scoring.ts and package.json changed, and have the agent undo anything the task didn't need
Show Answer

The correct answer is D. Reading the file list first is the cheapest check. A label task has no reason to touch the scoring file or the package list. A change in scoring.ts could alter how unrun checks count, which is a must-be-right rule. Accepting because the screen looks right (A) misses it. A longer message (B) doesn't fix scope creep. Deleting everything (C) throws away the good part.

Concept Tested: Agent Scope Creep

See: Agent Scope Creep


8. Two agent sessions on two branches both edited the line that sets the score when no checks ran, and the merge stops with a conflict. Who should resolve it?

  1. Whichever agent session finished last
  2. The builder, because the line touches a must-be-right rule
  3. Git, which keeps the newer change automatically
  4. Nobody: delete both branches and rewrite the line on main
Show Answer

The correct answer is B. Each side made sense to the session that wrote it, but only one can stay, and the line decides what a member sees when nothing ran. That's a judgment call on a must-be-right part, so the builder should make it. Git doesn't pick a side for you (C). Letting an agent pick (A) hands a product rule to whichever context happened to be loaded. Throwing away both branches (D) wastes good work.

Concept Tested: Merge Conflict

See: Merging and Merge Conflicts


9. git bisect finds that commit 9c03a5f broke the scoring test, and two good commits came after it. What is the safer fix on main?

  1. Reset main to the commit before 9c03a5f and force push
  2. Ask the agent to rewrite the scoring code from memory
  3. Revert 9c03a5f alone, keeping the two later commits
  4. Delete the test, since it was passing before
Show Answer

The correct answer is C. A revert undoes only the bad commit and keeps the people-search fix and the results page label, both of which work. A reset with force push (A) drops all three and rewrites shared history, a one-way door. Rewriting from memory (B) depends on drifting context. Deleting the test (D) removes the alarm instead of the problem.

Concept Tested: Rollback with Git

See: A Worked Rollback


10. Your branch list includes old-scoring, last touched four months ago and never merged. Why is it more dangerous than a stale branch for a button color?

  1. It carries four-month-old scoring rules, and merging it could quietly undo fixes made since
  2. Old branches slow down every Git command
  3. GitHub deletes branches after three months
  4. A stale branch always has merge conflicts
Show Answer

The correct answer is A. A stale branch holds the rules of the day it was made. Scoring is a must-be-right part, so merging an old version can bring back a bug that was fixed, such as counting an unrun check as passed. A stale button-color branch could only bring back a color. Old branches don't slow Git (B), GitHub doesn't delete them on its own (C), and conflicts aren't certain (D). Decide each stale branch's fate on a schedule.

Concept Tested: Stale Branch

See: Branch Hygiene