Skip to content

Instantly share code, notes, and snippets.

@p3jitnath
Created September 15, 2022 04:15
Show Gist options
  • Save p3jitnath/8db94a30cefea71c19982cda94a195dc to your computer and use it in GitHub Desktop.
Save p3jitnath/8db94a30cefea71c19982cda94a195dc to your computer and use it in GitHub Desktop.
Bash one-liner to indentify the big (unwanted) in a code-only repository
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