Last active
December 11, 2018 07:10
-
-
Save ohjho/eb486e5e5054f892d086b26ef111da6d to your computer and use it in GitHub Desktop.
shell script to show all blob objects in your git repo sorted from smallest to largest. For mac users, please comment out the last line. To run, place this in your git directory and run `sh git_blob_obj.sh`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment