Graphs and Git
The reason I've gone on at some length about graph theory is that a Git repository is one giant graph.
Most of the time when you interact with Git, you're working with commits in one way or another. At the surface level, a Git commit consists of two things: (1) a pointer to the state of your code at some moment in time, and (2) zero or more pointers to "parent" commits.
(Hint: the word "pointer" means you're probably talking about a graph.)
A Git commit is a node in a graph, and nodes can point to other nodes that came before them.
- About This Site
- Git Makes More Sense When You Understand X
- Example 1: Kent Beck
- Example 2: Git for Ages 4 and Up
- Example 3: Homeomorphic Endofunctors
- Example 4: LSD and Chainsaws
- The Internet Talks Back!
- Graph Theory
- Seven Bridges of Königsberg
- Places To Go, and Ways to Get There
- Nodes and Edges
- Attaching Labels to Nodes
- Attaching Labels to Edges
- Directed Versus Undirected Graphs
- Graphs and Git ←HEAD
- Visualizing Your Git Repository
- The Reference Reference
- Making Sense of the Display
- Garbage Collection
- Experimenting With Git
- References Make Commits Reachable
- My Humble Beginnings
- Branches as Savepoints
- Use Your Targeting Computer, Luke
- Testing Out Merges
- Rebase From the Ground Up
- Cherry-Picking Explained
- Using 'git cherry-pick' to Simulate 'git rebase'
- A Helpful Mnemonic for 'git rebase' Arguments
- The End