1

Is there a scenario where BFG doe not shrink a repo ?

I have used BFG repo multiple times over several repos with success. Great tool !

However, for one specific repo, I am not getting any reduction at all. The strange this is that I used BFG repo on this a few days ago and saw a 500 MB reduction but now after downloading a fresh repo and following the steps, I see an increase in the size (see pics below). To make sure my eyes weren't deceiving me, I re-ran BFG for another large repo and it was redcued by a third as expected. Only this repo is an issue.

So, before running BFG Repo Cleaner for this repo (i.e. running the git mirror command), this is the size of the my-big-repo.git folder enter image description here

After running

java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 20M some-big-repo.git

this is the size. Which is okay, because the repo hasn't been culled yet enter image description here

Plenty of files have been deleted, as I see in the output

Deleted files

    Filename                       Git id
    ---------------------------------------------------------------------------
    binhss.fru                   | 6ef438da (22.1 MB)
    158253.mp4                   | ca14075d (21.0 MB)
    24605.zip                    | 5b6c4eab (23.5 MB)
    24615.zip                    | 5423c47d (25.1 MB)
    40786.zip                    | 1e625ec7 (25.8 MB)
    40792.zip                    | af634c8e (25.2 MB)
    littleBit.zip                | 3a6a2563 (51.9 MB)
    XOOMOT.zip                   | 29f8097e (21.7 MB)
    Rapis.mp4                    | 9b83c06c (24.0 MB)
    Database_Backup.zip          | fc2657d9 (76.4 MB), e9033a52 (152.9 MB), ...
    Erskinine.dll                | 671d580e (24.7 MB)

However, after running the last commands

$ cd some-big-repo.git
$ git reflog expire --expire=now --all && git gc --prune=now --aggressive

this is the size

enter image description here

How is this possible ?

user1554876
  • 192
  • 3
  • 19
  • have you found the solution? I am facing the same issue, repo size is 1,2 GB due to mistakenly added error_log a year ago.. After running with BFG repo size does not shrink at all, and the file isn't in the latest commit. – Dovis Dec 09 '19 at 15:37
  • It's been a while so I can't quite recall the solution. But it had something to do with case sensitivity. Try not having spaces in your branch names and make sure they are named uniquely. – user1554876 Dec 10 '19 at 18:21

1 Answers1

0

Are all those files deleted in the latest commit?

The BFG treats your current commits as sacred, by default:

http://rtyley.github.io/bfg-repo-cleaner/#protected-commits

By default, the BFG will clean out old versions of your files, but will carefully preserve the contents of your latest files.

See also https://github.com/rtyley/bfg-repo-cleaner/issues/182

https://github.com/rtyley/bfg-repo-cleaner/issues/178

Roberto Tyley
  • 24,513
  • 11
  • 72
  • 101
  • Yes, that is the first thing I checked. However, I was not able to reduce the size even when I ran it with the "--no-blob-protection" flag on. The csv file in "protected-dirt" directory shows 4 protected - erskine.dll, Database-Backup.zip, Xomot.zip and binhss.fru. However, the other files removed should have reduced the size. Database-Backup.zip file has multiple versions which should have been removed as well. – user1554876 Oct 30 '18 at 15:59