Skip to content

Instantly share code, notes, and snippets.

@ledil
Created November 22, 2019 10:09
Show Gist options
  • Save ledil/4332335f17b80ae9b87c680d1d9f3748 to your computer and use it in GitHub Desktop.
Save ledil/4332335f17b80ae9b87c680d1d9f3748 to your computer and use it in GitHub Desktop.
Find largest object within git
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| sed -n 's/^blob //p' \
| sort --numeric-sort --key=2 \
| cut -c 1-12,41- \
| $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
@ledil
Copy link
Author

ledil commented Nov 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment