Created
April 1, 2019 06:52
-
-
Save HeshamMeneisi/1a4ebb54177506a8717fbf51d7a93cd5 to your computer and use it in GitHub Desktop.
Clean Big Files (gir 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
# http://blog.jessitron.com/2013/08/finding-and-removing-large-files-in-git.html | |
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 >> /tmp/large_files | |
gedit /tmp/large_files | |
git filter-branch --tree-filter 'rm -rf `cat /tmp/large_files | cut -d " " -f 2` ' --prune-empty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment