We hit 2GB in our repository. How can we run git gc in remote as we cannot push anything.
Hi Cris, Git GC is currently run Internally on a secured server by experts on the Bitbucket end. I would suggest to follow the below steps and see if this helps.
I would suggest you use the BFG tool in order to remove large files from the repository’s history. As per our Reduce repository size documentation https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html you can use BFG such as $ java -jar bfg.jar --strip-blobs-bigger-than 50M to remove all file bigger than 50M. You can customize the size of the files you want to remove according to your needs. Please refer BFG Repo-Cleaner by rtyley for the link https://rtyley.github.io/bfg-repo-cleaner/ to download the BFG jar and for more information on how to run BFG.
----------------------------------------
Here are the brief steps
----------------------------------------
git clone --mirror git://example.com/some-big-repo.git
java -jar bfg.jar --strip-blobs-bigger-than 50M some-big-repo.git
cd some-big-repo.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push
----------------------------------------
Post running this step, please reach out to Bitbucket support to run the Garbage Collection at the backend which will help reduce the size immediately.
Additionally, for future GC process, you can enable the below method:
-----------------------------------------
Beta Feature - Self Serve for Customers:
-----------------------------------------
You can enable an experimental feature to trigger GC automatically next time you accidentally push a large commit and go over the 2GB size limit.
Do this by clicking on your profile icon and selecting Bitbucket Labs, then enabling the feature "Delete dangling commits when oversize limit". This only affects your personal login; tell your team in case they want to try it out too.
Next time you accidentally push large files to Bitbucket, follow the user guide to reset the branch just before the large commit. When you force push that refs-only change, the Labs feature will automatically run GC to immediately remove the large commit. It may take several minutes for the GC to run and the size to update.
This should bring your Bitbucket repo below the size limit, allowing you to push commits again without having to raise a support request. Anyone else using the same repo who has pulled the large commit will need to create a fresh clone.
Note that this won't work if your repo goes over 5GB. In that case your repo is put into read-only mode and you will need to request help from the support team.
-----------------------------------------
thank you this is great!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
your welcome Cris, request you to please accept the answer if you feel this is what you were looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.