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.
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 repositories
This 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
HTTPS
git push --mirror https://<username>@bitbucket.org/<WorkspaceID>/<RepoName>.git
SSH
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
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:
Let me know how it goes
BEst,
Fadoua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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,
Fadoua
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.