Version Control as a Graph of Commits · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

History as a graph of snapshots

Computing · Software Engineering · ages 18-19
Name ______________________   Date ____________
  1. In the graph picture, what is a branch?

    • A copy of every file
    • A movable label on one node
    • A second repository
  2. In the graph picture, what is a commit?

    • A snapshot node pointing at its parent
    • A printer queue for changed files
    • A password guarding the folder
  3. Creating a branch at C adds no new node.

    Circle one:   True   False

  4. You check out an old commit directly. What is HEAD now?

    • A node with no branch label
    • A deleted file
    • A merged folder
  5. After A, B, C with main on C, you add feature at C and commit D on it. Where do the labels sit?

    • Both labels on D
    • Both labels back on A
    • Main on C, feature on D
  6. You commit twice while detached, then jump back to main. What threatens the two commits?

    • They auto-send to a server
    • No label holds them, so they may strand
    • They merge themselves at once
  7. A commit moves every branch label forward at once.

    Circle one:   True   False

  8. A teammate fears losing label-less commits. What is the safest fix?

    • Delete the commits at once
    • Hope the graph remembers
    • Stick a branch label on their tip
LightMySky · lightmysky.comW1-mt_oKsDRKirMy-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

History as a graph of snapshots W1-mt_oKsDRKirMy-s1

  1. A movable label on one node · Branches are labels, not copies.
  2. A snapshot node pointing at its parent · Commits are linked snapshot nodes.
  3. True · Only a second label lands on C.
  4. A node with no branch label · HEAD points at a bare node: detached.
  5. Main on C, feature on D · Only the active label slides to the new node.
  6. No label holds them, so they may strand · Label-less nodes strand when HEAD leaves.
  7. False · Only your active label slides.
  8. Stick a branch label on their tip · A label holds the nodes in the graph.
Worksheet · LightMySky