Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I have locally reduced the size of my repository to less than 500MB. However, the size shown in Bitbucket is still 2.2G. Could you please run gc to bring it down?
Best regards,
Hi gkamendje,
I have executed a gc which has reduced the size down from 2.2GB to 1.1GB.
To reduce the size further - I would suggest making use of the BFG tool to delete any large binary files present in your repository (or convert them to GIT LFS storage) - here's a command you can use to list these files:
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
Cheers!
- Ben (Bitbucket Cloud Support)
Hi Ben,
Thanks for your answers and suggestions. I would like to understand a couple of things.
1) When I clone my repo with the mirror option, it is only 354M why is it showing up as 1.1G in Bitbucket?
2) Assuming that I use BFG to remove large files, how do I make sure that the size I see locally matches the size that will be reported by Bitbucket once I push the changes back into bitbucket?
Regards,
G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @gkamendje
As part of our changes to improve speeds when displaying PR diffs - any large files that were present in PR's within your repository, get stored on the server-side. This is the most common reason why there is a difference:
Cheers!
- Ben (Bitbucket Cloud Support)
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.
Hi @gkamendje
A server-side gc has reduced the size back down to 1.1GB as it was before.
Can you please run the following command on your end to check if there are any other files that can be converted/deleted using BFG? Make sure not to share the output here as this is a public forum:
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
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ben
When I run the command I do not see any significantly large file. The largest files are around 5MB and these are text files (no binary file). As I mentioned before, the repo is down to less than 200MB on my side.
du -h -d 1
16K ./refs
68K ./hooks
12K ./info
136M ./objects
4.0K ./branches
136M .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @gkamendje
I'll need to access your repo directly from the server end to investigate this further, so I've raised a formal support ticket on your behalf (please check your email for further correspondence).
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!
Join an Atlassian Community Event!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.