Skip to content

Instantly share code, notes, and snippets.

@khaliqgant
Created December 29, 2022 12:51
Show Gist options
  • Save khaliqgant/323afb72258c9e5d2619f29cf1484174 to your computer and use it in GitHub Desktop.
Save khaliqgant/323afb72258c9e5d2619f29cf1484174 to your computer and use it in GitHub Desktop.
[Git Large Files In Repository] See large git files in a repository #git #cli
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
# source https://stackoverflow.com/questions/10622179/how-to-find-identify-large-commits-in-git-history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment