Skip to content

Instantly share code, notes, and snippets.

View warren-52's full-sized avatar
🦊

warren-52

🦊
View GitHub Profile
@warren-52
warren-52 / gist:98af47d859090e31c38285dbc2619f59
Created September 22, 2025 12:42
List N largest files in Git tree & Remove them before push
# List the N largest files in the Git tree (here N = 10)
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| sed -n 's/^blob //p' \
| sort --numeric-sort --key=2 \
| tail -n 10 \
| cut -c 1-12,41- \
| $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest