You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi there, I have pushed a large folder to my bitbucket last week so it reached over 4GB. after reading this link https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/ I was able to undo the last push. After that, I pushed another large folder accidentally and the repo size got ~2GB. Once I realized it, I deleted that large folder, deleted its branch, and everything related to that. However, after lots of effort bitbucket repo still shows 2GB. I also tried to rewrite history using BFG to see if it helps reduce the size of the repo but it didn't work either and my local repo size is much less than my bitbucket cloud.
Could you help me with that? Will `git gc` also help my case?
Hi @Kia Davari and welcome to the community.
I found the repo that was over 2 GB, I ran a git gc on it, and its size is 188.3 KB now.
Does this agree with the size of your local repo?
I'm afraid that users cannot run a garbage collection on remote repos at the moment. We have a feature request for that in our issue tracker that you can vote for and add yourself as a watcher if you'd like to get notified on updates:
Thank you so much. I've been struggling with this issue for 2 days and did everything to rewrite the history but none of them worked. Should I reach out to you again if it happens again? is there any way that I can clear the history?
BTW, not sure the repo size now is the same as what you see (188.3 KB). I just cloned the repo and the `size-pack` of `git count-objects -v` is 97.09 KB. is that right?
You are very welcome!
The automated garbage collection will get triggered if the repo size is over the 4 GB limit and you undo the last push, as per our documentation.
It will not get triggered if the repo size is below the 4 GB limit, or if it is over the limit but you perform any action other than git reset.
If you delete a branch with large files or rewrite history with BFG, you will need to contact us to run a git gc on the repo. You can either post a question in community or create a support ticket if the repo belongs to a workspace on a paid billing plan. You can create a ticket via https://support.atlassian.com/contact/#/, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product.
If the repo has multiple branches then the difference in `git count-objects -v` is expected, as when you clone a repo, the main branch is pulled only.