PIMP MY IDEBack to dispatches
October 11, 2026 / Git internals / repository craft

A commit does not weigh what its diff weighs.

The commit object is a small record that points at a tree. The stored cost of a change also includes new blobs, rewritten trees, logs, loose-object compression, and later packing.

Ask which bytes you are measuring before you call a commit big.

There are several honest answers

Dave Gauer measured changes in the size of an entire .git directory. His loose-object experiments ranged from 8,709 bytes for a tiny one-file change to 1,622,188 bytes after adding a 16,415,223-byte source file. In a repository with nested directories, one three-byte file edit created four objects: one commit, one blob, and two trees.[1]

Those numbers answer a useful question: how much did this repository directory grow under those conditions? They do not report the size of the commit object alone. The directory delta can include object files, reference logs, filesystem allocation, and other repository bookkeeping.

The diff is the event. Git stores a new snapshot route.

The commit carries pointers and identity

Git's own book describes a commit object as a record that names the top-level tree, parent commits, author, committer, and message. Tree objects map names and modes to blobs or more trees. Blob objects hold file contents.[2]

An edit deep in one directory can create a new blob and a new tree at each changed path back to the root. Unchanged blobs and trees keep their existing object IDs. This is why a three-byte edit can create more than two objects without copying every file in the repository.

Loose and packed are different measurements

Git's loose-object format adds a type-and-size prefix to object data, compresses the result with zlib, and stores it under a path derived from the object ID. Git later compacts loose objects into packfiles to save space and speed lookups.[3]

git cat-file exposes both an object's logical size and its on-disk size. The manual warns that on-disk size can be reported differently when an object is stored as a delta inside a pack. Use the same storage state when comparing results.[4]

Run three checks, not one

Measure the object itself with git cat-file -s HEAD. Inspect its contents with git cat-file -p HEAD. Then inspect object type, logical size, and current disk size in a batch:

git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(objectsize:disk)'

A before-and-after du still has value. Label it as repository growth. Record whether garbage collection or maintenance ran between samples. Do not turn that number into a property of one commit object.

Interactive object model

Commit cargo scale

Traditional purpose: a size calculator, object inventory, and copyable inspection plan. This scale refuses to invent a byte estimate. It counts the new objects implied by one stated directory model, then gives you commands for the real repository.

EditWrite objectsInspectCompare

Set the cargo

Assumption: every selected file receives unique new content, and all files sit in the same directory at the selected depth.

Choose inspection mode
STRUCTURE MODEL4 NEW OBJECTS

Load manifest

The model shows object count, not bytes. Real compression depends on the content and storage state.

4OBJECTS
One root tree plus one nested tree
STRUCTURE ESTIMATE ONLYThis is four new objects under the stated model. Git has not inspected your repository.
Sources read / October 11, 2026 UTC

Source log

Open the evidence boundary
  1. Dave Gauer, "How big is a Git commit?", updated July 24 and read October 11, 2026. This supplies the loose-object experiments, repository-size deltas, and four-object nested-file example. The measurements are from the author's test repositories.
  2. Pro Git, "Git objects", read October 11, 2026. This supports the roles and contents of blobs, trees, and commit objects.
  3. Git documentation, "gitformat-loose", read October 11, 2026. This supports the type-and-size prefix, zlib compression, object-ID mapping, and later compaction into packfiles.
  4. Git documentation, "git-cat-file", read October 11, 2026. This supports object inspection and the distinction between logical object size and current on-disk size.
  5. Hacker News discussion, item 50017548, verified through the official HN API and read October 11, 2026. We used the thread only as a current-interest signal.

Evidence boundary: Pimp My IDE read the named pages. We did not reproduce Gauer's experiments. The interactive scale is a teaching model. It does not read a repository, compress content, inspect filesystem allocation, or predict packfile deltas.