Skip to content

Instantly share code, notes, and snippets.

@coyotte508
Created November 11, 2013 22: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 coyotte508/7421632 to your computer and use it in GitHub Desktop.
Save coyotte508/7421632 to your computer and use it in GitHub Desktop.
git rev-list master | while read rev; do git ls-tree -lr $rev | cut -c54- | grep -v '^ '; done | sort -u | perl -e '
while (<>) {
chomp;
@stuff=split("\t");
$sums{$stuff[1]} += $stuff[0];
}
print "$sums{$_} $_\n" for (keys %sums);
' | sort -rn >> large_files.txt
git filter-branch --tree-filter 'rm -rf `cat /full/path/to/large_files.txt | cut -d " " -f 2` ' --prune-empty <BRANCHES>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment