Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 82817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:40:35+00:00 2026-05-10T21:40:35+00:00

I have a Git repository I store random things in. Mostly random scripts, text

  • 0

I have a Git repository I store random things in. Mostly random scripts, text files, websites I’ve designed and so on.

There are some large binary files I have deleted over time (generally 1-5MB), which are sitting around increasing the size of the repository, which I don’t need in the revision history.

Basically I want to be able to do..

me@host:~$ [magic command or script] aad29819a908cc1c05c3b1102862746ba29bafc0 : example/blah.psd : 3.8MB : 130 days old 6e73ca29c379b71b4ff8c6b6a5df9c7f0f1f5627 : another/big.file : 1.12MB : 214 days old 

..then be able to go though each result, checking if it’s no longer required then removing it (probably using filter-branch)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:40:35+00:00Added an answer on May 10, 2026 at 9:40 pm

    This is an adaptation of the git-find-blob script I posted previously:

    #!/usr/bin/perl 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();  my $exp = 10 * ( $unit eq 'b' ? 0 : $unit eq 'k' ? 1 : 2 ); my $cutoff = $max_size * 2**$exp;   sub walk_tree {     my ( $tree, @path ) = @_;     my @subtree;     my @r;      {         open my $ls_tree, '-|', git => 'ls-tree' => -l => $tree             or die 'Couldn't open pipe to git-ls-tree: $!\n';          while ( <$ls_tree> ) {             my ( $type, $sha1, $size, $name ) = /\A[0-7]{6} (\S+) (\S+) +(\S+)\t(.*)/;             if ( $type eq 'tree' ) {                 push @subtree, [ $sha1, $name ];             }             elsif ( $type eq 'blob' and $size >= $cutoff ) {                 push @r, [ $size, @path, $name ];             }         }     }      push @r, walk_tree( $_->[0], @path, $_->[1] )         for @subtree;      return @r; }  memoize 'walk_tree';  open my $log, '-|', git => log => @ARGV, '--pretty=format:%T %h %cr'     or die 'Couldn't open pipe to git-log: $!\n';  my %seen; while ( <$log> ) {     chomp;     my ( $tree, $commit, $age ) = split ' ', $_, 3;     my $is_header_printed;     for ( walk_tree( $tree ) ) {         my ( $size, @path ) = @$_;         my $path = join '/', @path;         next if $seen{ $path }++;         print '$commit $age\n' if not $is_header_printed++;         print '\t$size\t$path\n';     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 160k
  • Answers 160k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You may need of solutions to your problem from a… May 12, 2026 at 11:38 am
  • Editorial Team
    Editorial Team added an answer function myfunction() { if (document.getElementById('myform').selectedIndex == 0) { document.getElementById('noinput').style.display =… May 12, 2026 at 11:38 am
  • Editorial Team
    Editorial Team added an answer The code like this doesn't smell good for me. You… May 12, 2026 at 11:38 am

Related Questions

I'm a Git newbie. I recently moved a Rails project from Subversion to Git.
I have a SVN Repository at my main PC, to which only I have
I have a simple blog application written in Python, using Django. I use Git
A customer need a document managment system and I'm building information about this. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.