Warm-up · from “Debugging history with bisect and blame”
What is required for useful bisect results?
What is required for useful bisect results?
No notes: write what you remember, then check. Recalling before reading is what makes it stick.
The problem
You are asked to demonstrate that you understand Git without its convenient high-level commands. Build two commits and a release branch from scratch.
After this lesson you can
Construct a complete two-commit DAG with plumbing.
Verify tree structure and parent identity.
Explain Index and working-tree state.
Key terms
Full glossarySay what each term means, then open it to check.
DAG · from lesson 13
Directed acyclic graph; commit edges point to parents.
Index · from lesson 9
Prepared path-to-object entries, plus metadata and conflict stages.
Commit · from lesson 7
Object identifying a root tree, parent(s), metadata and message.
Tree · from lesson 6
Directory snapshot mapping names, modes and object IDs.
Visual mental model
- C1release
- C2main
Build the mental model
The required history begins with Commit 1 on main containing readme.txt with Core v1 plus newline. Commit 2 updates readme.txt to Core v2 plus newline and adds src/app.txt containing App plus newline; its parent is Commit 1. A release ref must point at Commit 1. Do not use git add, git commit or git branch during construction. Use supported plumbing rather than editing loose ref files directly.
Computed in your browser: sketch C1 and C2 before building them in the sandbox.
Under the hood
Before touching the terminal, draw the intended graph and list each object you need. The second tree reuses any unchanged objects if present; it must include the subtree for src. update-index can create a full-path entry and write-tree builds the hierarchy. commit-tree -p establishes parenthood. update-ref names the commits. Verify with cat-file, ls-tree and log, then restore files if desired.
Common mistake · important nuance
This is an independent challenge; read the lab instructions below as a verifier, not a command recipe. The complete construction appears in the answer appendix.