Git Internals
Merge Bases and Ancestry
Explain how Git uses common ancestors to reason about branch differences, merge inputs, and reachability.
The short version
Explain how Git uses common ancestors to reason about branch differences, merge inputs, and reachability.
Key ideas
- The common ancestor defines the comparison starting point
- merge-base directly shapes merge and rebase decisions
- Reachability underlies many Git queries
Why this helps you understand commands
Many command differences that feel arbitrary become easier once you see how Git is updating objects, refs, the index, or reachability.
Suggested follow-up
It pairs well with git show, git log --graph, git cat-file, git rev-parse, or git fetch.
PreviousReachability and Garbage Collection
Whether objects can still be recovered often depends more on reachability and garbage collection than on the command that made them harder to find.
NextTree Objects and SnapshotsExplain how tree objects encode directory structure and why commits represent full snapshot trees.