Can an admin please run garbage collection on my repo? I have removed some large files using BFG. I do not know how else to request this other than posting a question to the community. Is there a way to request this through the UI? Thanks.
Hello Susan,
and welcome to the community
I've run Git GC against your repository, however, it's size still at 930 MB.
This means that additional clean-up might be necessary to free-up some extra space. For this, you can follow the below steps in a local clone of the repository:
1. 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
2. Perform cleanup operations locally to reduce the size
3. Confirm the new size locally running the following command inside the repo's folder:
git count-objects -vH
4. After confirming the size has reduced locally, push your changes to Bitbucket Cloud
After the cleanup is executed, please let us know here, as we might need to run an additional garbage collection.
Let us know in case you have any questions.
Thank you, @Susan Begley !
Patrik S
Hi there,
I already ran the following after doing the BFG removals:git reflog expire --expire=now --allgit gc --prune=now --aggressivegit push
When I look at the largest files in my repo on a fresh clone, none of the previously largest files are there any more (the ones I removed).
If I do a new clone with the --mirror flag, go into the folder and run "git count-objects -vH", I get:count: 0size: 0 bytesin-pack: 216854packs: 1size-pack: 756.67 MiBprune-packable: 0garbage: 0size-garbage: 0 bytes
So why does Bitbucket think it's 930 MB?
Thanks for your help!
Hey @Susan Begley ,
Thank you for your confirmation.
This size discrepancy, even after cleaning up the repository and executing a GC on the server side, is likely related to large files that were previously pushed to pull requests in that repository.
To display diffs of pull requests after they are merged, Bitbucket Cloud must preserve the Git references of the commits that were part of those pull requests. In this case, even though you have cleaned those commits, Bitbucket still needs to retain those references to accurately show the pull request diff.
If you'd like to further reduce the repository size, one option is to delete the existing repository and push your cleaned-up repo to a new repository in your workspace. This new repository will not include the Pull request history of the original one, and should reflect a size closer to the one you see locally.
Are you saying there is no way to ever reduce the size of the repository? That even deleting the history of the files doesn't delete them entirely? I thought that there was a way to remove files permanently in case someone checked in sensitive data.
The files we deleted were never actually part of a pull request as they were added before we even started using branches and pull requests and never changed. Also, they are not text files. They should not be a part of the pull request diffs.
Is it possible for you to delete our pull request diffs?
It looks like you're new here. Sign in or register to get started.