Created
November 13, 2012 01:42
-
-
Save workmanw/4063343 to your computer and use it in GitHub Desktop.
Finding the biggest files in a git repo
This file contains 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 | |
IFS=$'\n' | |
for F in `git verify-pack -v .git/objects/pack/pack-*.idx | sort -k 3 -n | tail -10 | tail -r`; do | |
echo $F; | |
HASHKEY=`echo $F | cut -c 1-40` | |
FILEPATH=`git rev-list --objects --all | grep $HASHKEY | cut -c 42-128` | |
FILESIZE=`echo $F | cut -f 5 -d ' '` | |
FILESIZEHR=`echo "scale=2;$FILESIZE/1024/1024" | bc` | |
printf "\t $FILEPATH ($FILESIZEHR MB)\n\n"; | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment