If your git clone is suspiciously slow, there are probably large files hiding in the history. Here’s how to find them.
List the 10 largest files currently tracked in the repo:
git ls-files | xargs du -h | sort -rh | head -10But that only shows the working tree. The real culprits are often buried in git history. Find the largest objects across all commits:
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| sed -n 's/^blob //p' \
| sort -rnk2 \
| head -10 \
| numfmt --field=2 --to=iecThis lists the 10 largest blobs ever committed, with human-readable sizes.
Once you’ve identified the offenders, consider using git filter-repo to remove them or set up a .gitattributes with Git LFS for future large files.