Like a lot of people on the forum, I need someone to run git gc on my repo since it complains that I have exceeded the 1GB limit.
I spent a lot of time looking for a way to do this myself but seems like the only way around this to make a post here.
Welcome to the Atlassian Community @lordzombie !
I found the following when I googled how to perform yourself GC cleanup knowing that a user can only perform it in DC or Server:
https://www.google.com/search?q=how+to+clean+GC+in+Bitbucket+Cloud%3F&rlz=1C5CHFA_enUS1080US1080&oq=how+to+clean+GC+in+Bitbucket+Cloud%3F&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIHCAIQIRigATIHCAMQIRigATIHCAQQIRiPAjIHCAUQIRiPAtIBCjE2MTkzajBqMTWoAgiwAgHxBf_ngZt30wfR&sourceid=chrome&ie=UTF-8
Let me know how it goes
BEst,
Fadoua
Hi Fadoua, thanks for replying to my post.
I have already done these steps locally (use bfg to remove large files from my local git history). But when I try to push this to the remote repo, I get blocked by a message saying "remote: This workspace is over the 1 GB size limit. Reduce the size of your workspace or upgrade to a Standard or Premium plan to increase the size limit."
This effectively blocks me from doing anything to fix this issue on the remote repo. Even after cleaning my history locally, I cannot push anything to the remote repo. It makes the remote repo unusable because of the weird catch 22 situation going on here.
Any suggestions?
@lordzombie I requested Atlassian's assistance since you tried everything you could from your end.
Atlassian will get back to you within 2 days.
Best,
Hi @lordzombie ,
I have attempted to reduce the size of your largest repositories by executing a garbage collection, but it has not reduced the size much (100mb), and your workspace is still 2.5GB:
You have a couple of options to resolve this:
Option 1 - Delete & recreate the repositoriesThis is the fastest way to solve the problem, but loses metadata such as PRs, Pipelines, Permissions, etc.
git rev-list --objects --all \ | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \| awk '/^blob/ \{print substr($0,6)}' \ | sort -r --numeric-sort --key=2 \ | numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
HTTPSgit push --mirror https://<username>@bitbucket.org/<WorkspaceID>/<RepoName>.gitSSH
git push --mirror git@bitbucket.org:<WorkspaceID>/<RepoName>.git
NOTE: This will remove metadata such as PR's/pipelines/permissions etc but will keep your commit history and binary files intact.
Option 2 - Temporarily upgrade
Please let me know how this goes.
Best Regards
Shwetha Suvarna
It looks like you're new here. Sign in or register to get started.