Interview Prep/Git & GitHub/Repository Health, Size and Performance

A fresh clone downloads 4 GB, but the checked-out files are only 200 MB.

IntermediateTroubleshootingRepository Health, Size and Performance
Answer

Likely causes → Large binaries (dumps, builds, videos, .zip artifacts) were committed at some point. Even if deleted later, every version lives in history forever.

Diagnose → List the biggest blobs across all history:

git rev-list --objects --all |
  git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' |
  awk '$1=="blob"' | sort -k3 -n -r | head -20
git count-objects -vH

Fix → Short-term, give developers git clone --filter=blob:none (partial clone). Long-term, rewrite history with git filter-repo --strip-blobs-bigger-than 10M or --path big/dir --invert-paths, move real binaries to Git LFS, force-push, and have everyone re-clone.

Prevent → Block large files with a pre-receive check or a ruleset (max file size), and a .gitignore for build outputs.

All Git & GitHub questions Roadmap: Git & GitHub

More on Repository Health, Size and Performance