Created
January 6, 2012 19:50
-
-
Save notmyname/1572082 to your computer and use it in GitHub Desktop.
git-largest command to find the largest objects in a repo's history
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/sh | |
COUNT=10 | |
if [ $# -gt 0 ]; then | |
COUNT=$1 | |
fi | |
if [ ! -r .git/objects/pack/*.idx ]; then | |
git gc | |
fi | |
for n in `git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -n $COUNT | cut -d ' ' -f 1 `; do | |
git rev-list --objects --all | grep $n | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment