Our repository grew up beyond 2GB.
I cleaned up the local repo, and followed up the steps to reduce the repo size, but it just got locked, so I can't push any change.
Can you help me?
Hi Franco,
When a repo goes over 2GB and you switch to the commit before the bad one, a git gc is needed on the remote repo. This should run automatically if you have enabled the Lab feature Delete dangling commits when over size limit. I can see this is not enabled for your Bitbucket account, so I believe this is why the git gc did not get triggered.
I checked your account in our system and found which repo is more than 2 GB from the ones you have access to, and ran a git gc on it. Its size is now 1.3 GB so you and your team should be able to push.
Now, for reducing the repo's size, removing a file with git rm will not remove it from the repo's history.
If you have any files/folders in the repo that do not need to be versioned, you can remove them either with git filter-branch or with a tool like BFG
Afterwards, you can check the size of your local repo with
git count-objects -Hv
It will be the sum of the fields size and size-pack in the output. If you're ok with the new size, you can push that to Bitbucket. Please note that when you do this the repo size will go up again. Don't be alarmed, this is expected because the remote repo will contain both old and new refs. Another git gc will be needed on the remote repo to have the old refs removed, and its size should then go down.
If you push history rewrite, the git gc won't get triggered automatically, so I would suggest opening a ticket with the support team right after to request a git gc for that specific repo. You can do so via the following link:
https://support.atlassian.com/contact/#/
In "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. In "What is the impact to your business?" make sure to select "Level 1" if the repo is over 2 GB and your team is blocked from working, to ensure you get a timely response.
If you have any questions, please feel free to let me know.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome, glad to have helped.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please go into more detail what steps you followed to reduce the repo size?
(I wish I could comment the question, as this isn't really an answer...)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for answering.
When the repo was blocked, I switched to the commit before the bad commit and pushed (as the oficial guide says).
Then, I deleted the Pods/ folder (iOS repo, an old and bad decision), ran git gc --aggresive, git rm -rf Pods/, even ran filter-branch.
But it doesn't seems to like it, because I couldn't push.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.