Git Made Crystal Clear · chapter 3: Core Concepts: The Three Trees and the Object Model

Object model and a small DAG: a commit points to one tree (which points to blobs) and...

2026-09-07

Below: the paragraph from the book that builds this idea, then the diagram itself (Figure 3.2.), and a recap. About a minute of reading.

On top of that graph sit refs, which are just pointers to commits: branches live in refs/heads/*, remote-tracking branches in refs/remotes/*, and tags in refs/tags/*. A branch is simply a movable pointer: a small file containing one commit hash. That is why creating a branch is instant, no matter how big the project. HEAD is the pointer to your current branch (or directly to a commit, when it is "detached").

Figure 3.2. Object model and a small DAG: a commit points to one tree (which points to blobs) and to its parent commit; a branch is a pointer to a commit, and HEAD points to the branch.
Figure 3.2. Object model and a small DAG: a commit points to one tree (which points to blobs) and to its parent commit; a branch is a pointer to a commit, and HEAD points to the branch.

Recap

  • The idea: Object model and a small DAG: a commit points to one tree (which points to blobs) and to its parent commit; a branch is a pointer to a commit, and HEAD points to the branch.
  • The picture: Figure 3.2., from chapter 3 ("Core Concepts: The Three Trees and the Object Model") of Git Made Crystal Clear.
  • Go deeper: the chapter builds this step by step, with recipes and sources at the end.

This diagram is one of many in Git Made Crystal Clear.

Every chapter opens with the gist, draws the hard ideas, and ends with recipes and sources.

Get the book

All diagrams