Created
July 24, 2018 10:50
-
-
Save steventux/f3484713c340252e049c6159b02d08ea to your computer and use it in GitHub Desktop.
List the largest git repo objects
This file contains hidden or 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
#!/bin/bash | |
git_dir=$1 | |
cd $git_dir && 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 | awk '$2 >= 2^20' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment