Skip to content

Instantly share code, notes, and snippets.

@techraf
Last active February 1, 2021 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save techraf/7dc802d10e873a1f36c07c019391ba7c to your computer and use it in GitHub Desktop.
Save techraf/7dc802d10e873a1f36c07c019391ba7c to your computer and use it in GitHub Desktop.
git commit size
# https://stackoverflow.com/a/42544963
# using numfmt on GNU
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- | numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
# using gnumfmt on MacOS
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- | gnumfmt --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