Bitbucket reduce repo size with BFG

时光怂恿深爱的人放手 提交于 2021-01-29 03:34:07

问题


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.


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!