Skip to content
Calcrivo

Repository Size Calculator

Estimate total Git repository size from loose objects, packfiles and LFS storage, and compare .git size to working tree size.

Inputs

MB

Size of uncompressed loose objects in .git/objects before packing.

MB

Size of compressed .pack files (history, blobs, trees, commits).

MB

Size of large files tracked via Git LFS (binaries, media, datasets).

MB

Size of the checked-out files on disk, excluding .git.

Total Repository Size

710MB

.git Directory Size

510MB

Total Repository Size

0.69GB

.git / Working Tree Ratio

2.55×

LFS Share of .git

23.5%

Step by step

  1. .git directory: loose + packfile + LFS

    40 + 350 + 120

    = 510MB

  2. Total repository: .git + working tree

    510 + 200

    = 710MB

  3. .git-to-working-tree ratio

    510 / 200

    = 2.55×

How it works

A repository's on-disk footprint is the sum of its .git directory (loose objects awaiting packing, compressed packfiles holding history, and any Git LFS content) plus the working tree of checked-out files. Formula: total = loose_objects + packfiles + lfs_objects + working_tree. A high .git-to-working-tree ratio usually signals deep history or large binaries that were committed directly instead of through LFS.

Formula

total_repo_MB = loose_objects + packfiles + lfs_objects + working_tree

loose_objects
Uncompressed loose object size (MB)
packfiles
Compressed packfile size (MB)
lfs_objects
Git LFS storage size (MB)
working_tree
Checked-out working tree size (MB)

Frequently Asked Questions

Why is my .git folder bigger than my actual code?

Every version of every file you've ever committed still lives in .git's history, even after deletion. Large binaries, generated files, or media committed directly (instead of via LFS) accumulate across commits and bloat the packfile.

How do I find the real size of loose objects vs packfiles?

Run `git count-objects -v` — it reports loose object count/size and, after a `git gc`, the packed size. `du -sh .git` gives the total directory size.

Does Git LFS reduce .git size?

Yes — LFS stores pointers (a few bytes) in Git history and keeps actual large file content in separate LFS storage, so .git/objects and packfiles stay small even as binary history grows.

How can I shrink an existing bloated repository?

Run `git gc --aggressive` to repack loose objects, or use `git filter-repo`/BFG Repo-Cleaner to rewrite history and remove large blobs, followed by a fresh clone to reclaim disk space.

You might also need