Created
March 24, 2014 14:23
-
-
Save alerque/9741030 to your computer and use it in GitHub Desktop.
Quick shell script to list the actual size on disk of what git has stored for each commit in a 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/zsh | |
git rev-list --all| | |
while read sha; do | |
let total=0 | |
git diff-tree -r -c -M -C --no-commit-id $sha | | |
cut -d' ' -f3 | | |
while read blob; do | |
case $blob in | |
0000000000000000000000000000000000000000) | |
continue | |
;; | |
*) | |
let total+=$(git cat-file -s $blob) | |
;; | |
esac | |
done | |
echo "${sha[0,7]} $total" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment