问题
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,
- git clone --mirror git://example.com/some-big-repo.git
- java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 100M some-big-repo.git
- cd some-big-repo.git
- git reflog expire --expire=now --all && git gc --prune=now --aggressive
- 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.
回答1:
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?
回答2:
To address the second part of your question, you can use the backup you created to undo your changes. https://rtyley.github.io/bfg-repo-cleaner/#usage
来源:https://stackoverflow.com/questions/58412173/bitbucket-reduce-repo-size-with-bfg