Skip to content

Instantly share code, notes, and snippets.

View natj's full-sized avatar

Joonas Nättilä natj

View GitHub Profile
@datguy
datguy / git-large-blob
Last active June 26, 2019 12:18
find large objects in your git repository, listed by commit (also shows how long ago the commit happened)
#!/usr/bin/perl
# from http://stackoverflow.com/questions/298314/find-files-in-git-repo-over-x-megabytes-that-dont-exist-in-head
use 5.008;
use strict;
use Memoize;
sub usage { die "usage: git-large-blob <size[b|k|m]> [<git-log arguments ...>]\n" }
@ARGV or usage();
my ( $max_size, $unit ) = ( shift =~ /^(\d+)([bkm]?)\z/ ) ? ( $1, $2 ) : usage();