HeadlinesBriefing HeadlinesBriefing.com

How Big Is a Git Commit? Size Breakdown & Experiments

Hacker News •
×

Git commit sizes vary based on file compressibility and directory structure. Experiments show that an empty repo takes about 64,828 bytes, while committing 250 tiny files adds 47,640 bytes. A 3-byte change in a 50-file directory costs 17,145 bytes, and a single-file change adds just 8,709 bytes.

Larger files like a 583KB binary or 16MB source file result in 297,873 bytes and 1,622,188 bytes respectively. Git’s zlib compression and packfile optimization reduce redundancy, making it highly efficient—storing only 10–50% of the original file size. Each commit creates new objects, but the system is designed to minimize overhead even for tiny changes.

Source: Hacker News · Summarized by HeadlinesBriefing