rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
10.98k stars 547 forks source link

Repository size does not change after running BFG and pushing to remote #518

Open dmytrob opened 1 month ago

dmytrob commented 1 month ago

Hi, I have a repository where some binary files were committed accidentally and many times. Thus, repository size is ~2.4GB if I do a fresh clone. Then I run BFG

java -jar bfg-1.14.0.jar --strip-blobs-bigger-than 3M .

output

Deleted files
-------------

    Filename                                                       Git id                                
    -----------------------------------------------------------------------------------------------------
    978-1-4939-0802-8.pdf                                      | c8299da9 (29.4 MB)                    
    9781400880034-005 (1).pdf                                  | 1bd64246 (3.2 MB)                     
    Data.csv                                                   | 50be49fb (55.3 MB)                                
    Detumbling100.mat                                          | 504f19c7 (880.5 MB)                   
    DetumblingTest3.mat                                        | 68278076 (2.6 GB), 0ab3a26e (404.0 MB)                     
    Sat.stl                                                    | 2d2bfe17 (14.7 MB)                    
    Safehold.csv                                               | 3a339cc7 (128.6 MB)                   
    Input.csv                                                  | f565161e (108.6 MB)                   
    Output.csv                                                 | 174a7910 (172.4 MB)                                       
    simulation.mldatx                                          | 5113cf65 (1.4 GB)                                 
    ...

after that size of local checkout is

$ du -sch . 
2,4G    .
2,4G    total

then I run

git reflog expire --expire=now --all && git gc --prune=now --aggressive

Output

$ du -sch . 
150M    .
150M    total

Finally I push it to remote

git push --force 

Afterwards I clone the repo again, in an another directory, and the directory has size of 2.4GB again.

Apparently I do something wrong, or in a wrong order, but can't figure out what exactly.

Could someone please clarify what is the proper workflow here?

Thanks!

arpan3t commented 1 month ago

Are you doing a mirror clone like the guide specifies?
git clone --mirror git://example.com/some-big-repo.git

dmytrob commented 1 month ago

hi, yes, I tried both wit --mirror and without and the result is the same