Skip to content

Instantly share code, notes, and snippets.

@gizmola
Created September 4, 2014 18:07
Show Gist options
  • Save gizmola/369a85ea96836abd3041 to your computer and use it in GitHub Desktop.
Save gizmola/369a85ea96836abd3041 to your computer and use it in GitHub Desktop.
Get list of largest files in a git repo from bash
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];
}
"$sums{$_} $_\n" for (keys %sums);
' | sort -rn >> large_files.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment