Git stores a project snapshot as linked objects, not as a separate full project copy for every branch or commit. File contents live in blobs; trees record names and directory structure; commits point to a root tree and earlier commits; and branch names are movable references to commits.
How Git stores a snapshot
A Git snapshot is assembled from objects in the repository’s object database. Each object is identified by an object ID, and objects are immutable once created. The core model has four useful categories: objects, references, the index, and reflogs. Git’s data model documentation uses this terminology (version 2.56.0, updated 2026-09-28).
Blobs hold file contents
A blob stores a file’s content, without its filename or directory location. If a new commit changes only a few files, Git can reuse the existing blob objects for unchanged contents rather than create a fresh copy of every file’s bytes.
Trees record names and structure
A tree represents a directory. Its entries record names, modes, and object IDs for files or child directories. Files point to blobs; subdirectories point to other trees. The top-level tree therefore describes the project’s directory structure and connects each path to its content.
#1 Best Overall
Commits connect snapshots to history
A commit points to the root tree for one project snapshot and records commit metadata, including author and committer details and a message. It also points to one or more parent commits. Following those parent links traces history; a merge commit can have multiple parents.
For a longer explanation of these object relationships, see the Pro Git Git Internals guide.
Rank #2
What a Git commit is made of
Conceptually, a commit is a history object that names a tree and its parent commit or commits, along with metadata. The tree represents the snapshot; the parent links place that snapshot in the project’s history. A commit is not the branch itself, and the branch is not embedded as a copy of the project in the commit.
Are Git branches copies of the project?
No. A branch is a lightweight, movable reference to a commit. In the usual workflow, making a commit on the current branch advances that branch’s reference to the new commit. The commit and the objects reachable from its tree remain in the object database; the branch name simply identifies a history endpoint. Pro Git describes the concept this way: “A branch in Git is simply a lightweight movable pointer to one of these commits.” See Branches in a Nutshell.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsWhat staging and committing do
The index, often called the staging area, holds the content prepared for the next commit. It is distinct from both the working directory and the tree already recorded by an existing commit. At a high level, git add updates the index with selected content. git commit writes the needed tree structure and a commit object, then advances the current branch reference.
Refs are named pointers into the object database. HEAD identifies the current checkout; when HEAD is attached, it refers symbolically to the current branch. The Pro Git references chapter explains refs and branch pointers, while the index chapter covers staging.
Quick Recap
Best Value
Blob, tree, commit, branch, index, and HEAD compared
| Git concept | What it represents |
|---|---|
| Blob | The contents of a file. |
| Tree | A directory’s entries, names, modes, and links to file blobs or child trees. |
| Commit | A reference to a root tree plus commit metadata and parent commit links. |
| Branch | A movable named reference to a commit. |
| Index | The staging area describing content prepared for a future commit. |
| HEAD | The marker for the current checkout; in the usual attached state, it refers to the current branch. |
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




