Skip to content

Instantly share code, notes, and snippets.

@mratsim
Created September 8, 2017 11:07
Show Gist options
  • Save mratsim/3aba139470a9ed8935c9f2a65ecc6b11 to your computer and use it in GitHub Desktop.
Save mratsim/3aba139470a9ed8935c9f2a65ecc6b11 to your computer and use it in GitHub Desktop.
Git: find big files
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| awk '/^blob/ {print substr($0,6)}' \
| sort --numeric-sort --key=2 \
| cut --complement --characters=13-40 \
| numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment