I tried to clean up my repository and reduce the size since I was getting 2GB warning. I deleted a big size folder from history and repository. My local repository size is now 439M but on Bitbucket cloud the repo size increased to ~3.2 GB. I tried git gc and it didn't help. Any ideas how to reduce the size of repository on bitbucket.
Hi @santpal and welcome to the community!
If you rewrite history and push to the remote, it is expected that its size will go up, because the remote repo will contain both old references (prior to history rewrite) and new ones (after history rewrite). A git gc is needed on the remote repo to remove any old references. While end users can run a git gc on their local repo, it is not possible for them to trigger a git gc on the remote repo.
I checked the repos your account has access to, I found the one with a size of 3.2 GB and I ran a git gc on it. Its size has been reduced, please feel free to let me know if it looks ok on your end.
We have a feature request for allowing users to trigger a git gc on their remote repos:
In the meantime, if you ever rewrite history again and would like a git gc for your remote repo, you can create a question in community and a member of the support team can do it.
Kind regards,
Theodora
Thank you for the update and you are very welcome!
Please feel free to reach out if you ever need anything else.
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.
Hi @santpal and welcome,
probably you local repo has not all the history. Btw, in order to reduce repo size, please take a look to the following article https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fabio,
I followed the link above. The issue is that I removed file/folders from repo to reduce the size of the repo - The size reduced on the local repo but on bitbucket the size increased to even more than before giving me 2GB warning again. I don't see any dangling commit either. Rewind history will lead me to files and folders that I didn't want in the first place.
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.