It looks like I am facing the same issue.
My git repo was 3.3Go.
I used bfg to remove one large file
then use git reflog and git gc
then push -f to rewrite history
It worked for develop branch, but now I can't do the same things for master branch because the size is now 4.04Go so my push is rejected.
I used git count-objects obtaining:
size: 0 octet
size-pack: 789.02 Mio
size-garbage: 0 octet
@kelkk I tried a solution with an other git repo.
After using bfg, git reflog and git gc, i create an other git repo and use on my initial local repo:
git remote set-url origin email@example.com:me/my-new-git.git
git push -f --all origin
it worked, but I don't want to redo all my git settings, variables, etc...
Hi @Nicolas Eche,
I checked the repositories that your Bitbucket Cloud account has access to and I found one over the 4 GB limit. I ran a git gc on it and its size is 795.5 MB now.
When you rewrite history and push your changes, the remote repo's size will go up because it will contain both old and new references. A git gc is needed on the remote repo for the olds refs to get removed and for the repo's size to get reduced.
If you need to remove files from the history of all branches, I would recommend running BFG on a mirror clone (as mentioned here: https://rtyley.github.io/bfg-repo-cleaner/), this way you will not have to repeat the process for every branch.
If you plan to use BFG again to reduce the repo's size further, please feel free to let me know after you push your changes and I can run another git gc. Alternatively, you can also create a ticket with the support team and ask them to do so, since the repo is owned by 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. In "What is the impact to your business?" please make sure to select Level 1 if the repo is over the size limit and you are blocked from working.
We have a feature request to allow users to initiate a git gc for remote repositories:
You can add yourself as a watcher in that feature request by selecting the Start watching this issue link if you'd like to get notified on updates.
Just a heads up, I moved your post to a new question. It's best to create a new question for your issue instead of replying to an existing question, as this way your new question will be visible to my colleagues as well when I'm out of office (and you'll get help faster if I'm out of office for a long time).
If you have any questions, please feel free to let me know.
You are very welcome!
I can of course run another git gc; would you mind sharing the last two letters of the repo's name or the repo's size in Bitbucket Cloud, so I can identify which one it is and run the git gc?
Last week I could identify it based on the repo size you mentioned, but I cannot recall now which one it is.
Please keep in mind also that the repo will go in read-only mode while the git gc is running, to avoid any corruption.
Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events