bfg-repo-cleaner/ 'nuff said
- http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history/
- https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
~/bin/findbigfiles.sh - creates bigtosmall.txt
~/bin/git_find_big.sh
~/bin/remove-files-from-repo.sh
find . -name '*.git' -execdir sh -c 'cd {} && git gc' \;
find . -name '*.git' -execdir sh -c 'cd {} && git gc --aggressive --prune=now' \;
find . -name '*.git' -execdir sh -c 'cd {} && realpath . && echo && git gc --aggressive --prune=now && git fetch --all && git b -avv && echo '---------------------' && echo ' \;
questions/1029969/why-is-my-git-repository-so-big questions/1284669/how-do-i-manage-large-art-assets-appropriately-in-dvcs BITBUCKET/Reduce+repository+size
http://metalinguist.wordpress.com/2007/12/06/the-woes-of-git-gc-aggressive-and-how-git-deltas-work/
So the equivalent of "git gc --aggressive" - but done properly - is to do (overnight) something like
git repack -a -d --depth=250 --window=250
where that depth thing is just about how deep the delta chains can be (make them longer for old history - it's worth the space overhead), and the window thing is about how big an object window we want each delta candidate to scan.
And here, you might well want to add the "-f" flag (which is the "drop all old deltas", since you now are actually trying to make sure that this one actually finds good candidates.
http://stackoverflow.com/questions/11255802/after-deleting-a-binary-file-from-git-history-why-is-my-repository-still-large https://confluence.atlassian.com/display/BITBUCKET/Reduce+repository+size http://stevelorek.com/how-to-shrink-a-git-repository.html