DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk3 min

How Git Stores Snapshots, Branches, and Commits

Git stores snapshots in blobs and trees, connects them with commits, and uses movable branch references instead of copying the project for each branch.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What 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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.