The History Graph: Parent, Hash, and the DAG
Last lesson we saw that each commit is a snapshot — a full picture of the project. Now we ask: how are those pictures connected to each other? Every commit carries a little 'note' pointing at the commit that came before it — its parent. Chaining those notes forms a graph that flows one way, from pas
Each picture (commit) carries a note: 'I came right after that picture'. Those notes chain the pictures into a one-way map. And every picture has a unique fingerprint — change anything, and the fingerprint changes.
- Parent
- The pointer from a commit to the commit that came before it. Chaining parent pointers is what forms history.
- DAG (Directed Acyclic Graph)
- The shape of Git history: each commit points back to its parent, and that chaining forms a graph that flows one way, with no cycles.
- Hash (SHA id)
- A fixed-length unique fingerprint derived from the commit's content (including its parent). Change even one character and the hash changes.
- Root commit
- The first commit in a repo. It is the only one with no parent — the starting point of the graph.
- Metadata
- The information attached to a commit: who wrote it, when, and the message. It too feeds into the hash.