Skip to content

Instantly share code, notes, and snippets.

@BBBSnowball
Created November 15, 2013 12:07
Show Gist options
  • Save BBBSnowball/7483358 to your computer and use it in GitHub Desktop.
Save BBBSnowball/7483358 to your computer and use it in GitHub Desktop.
Find big commits in git
#!/bin/sh
# http://stackoverflow.com/a/1557398
for sha in $(git rev-list --all --pretty=format:"" | sed "s/^commit //") ; do git diff-tree -r -c -M -C --no-commit-id $sha | awk '{print $4}' | git cat-file --batch-check 2>/dev/null | awk '{ sum+=$3 } END {printf "%010d %s\n", sum, "'"$sha"'"}' ; done | sort | tail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment