Skip to content

Instantly share code, notes, and snippets.

@qnighy
Created February 21, 2017 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qnighy/e88e6d100bee26038068665614d8112f to your computer and use it in GitHub Desktop.
Save qnighy/e88e6d100bee26038068665614d8112f to your computer and use it in GitHub Desktop.
Yet another git-findbig, which looks for largest files in your repository.
#!/bin/bash
set -ue
echo "sha1 size size-on-disk path"
join -a 1 \
<(git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(objectsize:disk)' --batch-all-objects | grep '^blob' | cut -d ' ' -f 2- | sort -k1) \
<(git rev-list --all --objects | sort -k1) \
| sort -k2rn | head -n 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment