Skip to content

Instantly share code, notes, and snippets.

@notmyname
Created January 6, 2012 19:50
Show Gist options
  • Save notmyname/1572082 to your computer and use it in GitHub Desktop.
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
#!/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