removing files using git-filter-repo

113 Views Asked by At

I have a huge repo and I want to shrink it. A git-filter-repo --analyze shows that I had commited loads of tiffs (by mistake, directory doesnt exist anymore) and I would like to remove all these from my history and shrink the size of my .git file.

The top3 in my directories-all-sizes.txt is:

=== All directories by reverse size ===
Format: unpacked size, packed size, date deleted, directory name
  10427033696 2301950509 <present>  <toplevel>
  4835103008  917677623 <present>  data
  4398972219  825347243 2020-12-29 data/fov
  3972526203  745309155 2020-05-20 fov

and extensions-all-sizes.txt

=== All extensions by reverse size ===
Format: unpacked size, packed size, date deleted, extension name
  2464104104 1412058140 2020-12-29 .tif
   278175984  272096000 <present>  .gif
  1249866460  269140539 <present>  .json
  5991626887  172076504 <present>  .csv
   215493375   71506246 <present>  .tsv

I would like to remove the folder data/fov (this is where the tifs are) and most (but not all) of my gif, json, csv, tsv files.

How do I do this please?

1

There are 1 best solutions below

0
Karolis On

You could try using bfg-repo-cleaner.

For example, I was removing some committed large files from the repository:

java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 50M

But there are more examples in the documentation.