I only have one Repositories with 987MB and it said This workspace is over the 1 GB size limit.
I have followed the instructions in https://support.atlassian.com/bitbucket-cloud/docs/maintain-a-git-repository/ and delete all the files from git_find_big.sh by git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD
After I run git push --all --force to push all the changes, however I got this output:
git push --all --forceEnumerating objects: 16213, done.
Counting objects: 100% (16188/16188), done.
Delta compression using up to 96 threads
Compressing objects: 100% (6301/6301), done.
Writing objects: 100% (16143/16143), 248.39 MiB | 37.00 KiB/s, done.
Total 16143 (delta 12059), reused 11009 (delta 9658), pack-reused 0
remote: Resolving deltas: 100% (12059/12059), completed with 11 local objects.
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.
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
so I cannot get out of this loop, Anyone knows how to due with this.
Also what size will allow me to escape the read-only mode? Any assistance would be appreciated!
Welcome to the community.
I can see your workspace is now down to 15 MB size, could you confirm if you're seeing the same on your end?
You can check that by following the steps below:
Regards,
Mark C
Hi @Mark C
Thanks for your reply. Thats not my own workspace, that is https://bitbucket.org/AMLMPT/ instead.
Now my issue is changed,
first, I get top 20 by the code git_find_big.sh
second, I deleted top 20 by code git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD(I think I did wrong here as I want to remove the files from the start)
third, I push to bitbucket. (git push --all --force)
but when I check the repositories space, it didnt drop, it grows instead(from 980MB->1.2GB)
when I rerun git_find_big.sh all the files are still there
when I rerun git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename'(no HEAD now) it said Ref 'refs/heads/master' is unchanged and nothing changed.
I have no idea what to do now, any suggestions? Thanks.
Regards,
Harry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you try to use the BFG tool instead? - https://support.atlassian.com/bitbucket-cloud/docs/maintain-a-git-repository/#Using-the-BFG-to-rewrite-history
Let me know once done and I will run Git GC again.
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mark C ,
Thanks for your reply. I have used BFG tool to delete the files. But still the same output when I run git_find_big.sh.
Regards,
Harry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've run Git GC again, however, it didn't reduce the size.
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.
Perform a clone of those repositories for backup purposes
Delete those repositories from your workspace to free up space and allow you to push. NOTE: This will permanently remove metadata such as PR's/pipelines/user permissions etc.
Identify the largest files in your repositories by executing the following command:
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
Perform cleanup operations locally to reduce the size
Once complete, push those repositories back to your workspace by creating a blank repository with the same name of the deleted repository, then mirror pushing the contents of the cleaned repository:
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
Upgrade to a paid plan and utilise our 30-day trial period to restore functionality and provide more time to reduce your repository directly without deletion. You can choose to continue or cease your trial before the end of the 30-day period.
If you encounter any issues during this period - you may raise a ticket directly with our support team using your workspace URL: Atlassian Support
Please let me know how this goes.
Regards,
Mark C
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.