bitbucketgit-rewrite-historybfg-repo-cleaner

Bitbucket reduce repo size with BFG


My team's repo on Bitbucket was 1.34GB due to some static assets (videos, images)

I've followed instructions from BFG Repo Cleaner

and my repo is now 2.37GB which is over our 2GB quota and it is now read only.

The commands I've run were pretty much what's on the BFG Homepage,

  1. git clone --mirror git://example.com/some-big-repo.git
  2. java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 100M some-big-repo.git
  3. cd some-big-repo.git
  4. git reflog expire --expire=now --all && git gc --prune=now --aggressive
  5. git push

After I run this commands my repo grew to the 2.37GB mark. However if I run git count-objects -v my size-pack is now: size-pack: 1073518 as opposite as before it was size-pack: 1213524. So in theory my repo is smaller.

I dont know because this is hosted in Bitbucket cloud If I need them to run anything on the server or not, some places (gitlab, github) seem to need "them" to run git gc on the server.

Is this necessary? Is there anyway I can undo all my changes with that git push? I have the some-big-repo.git.bfg-report report with all the changes, but I dont know how to use that report to revert my changes.


Solution

  • Note that Bitbucket docs on Garbage collecting dead data say:

    After you push your changes, contact Support to run a git gc on the server for you. This is git garbage collection which runs housekeeping tasks on the repository to reflect the change in the size.

    ... have you asked them to run 'git gc' yet?