Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups


We have accidentally uploaded a backup and we have exceeded the allowed limit of 4Gb.


I have deleted the files locally, but I can no longer commit because I always get the same error.


Can you please help me?


2 answers

0 votes

Hi @Salazar Comunicación,

I can see one repo over the 4 GB limit from the ones you have access to. I ran a git gc on it, and its size is 1.4 GB now.

If you still want to remove the problematic file(s) from the repo, please note that committing the file's deletion is not going to remove it from the repo's history.

The proper way to do that would be to rewrite history to remove this file from the repo's history, as Mikael suggested.

You can take a look at BFG repo cleaner page on how to do that:

In the section Examples, you will see that you can use the argument --delete-files to remove specific files.

Please note:

  • Always take a backup of the repo before you rewrite history, in case you accidentally delete something you didn't want to and want to recover the repo to the prior state. You can take a backup by cloning with the --mirror flag (other than the one where you execute BFG):
git clone --mirror repo_url
  • If you use BFG, I would suggest first pushing the changes to a newly created empty repo before you push to your existing one, to inspect if the changes look ok.

  • Please note that rewriting history means that the commit hashes of the repository will change. It's good to communicate this to your team if you do that, so there are no surprises, and also so that they take a fresh clone of the repo after you push your changes (and avoid pushing the old history back)

  • If you have an integration with Jira Cloud, and you reference Jira issue keys in Bitbucket commit messages or PRs:

    When you rewrite history, the commit hashes will change. When you push your changes, Jira issues will reference the new commits, you don't need to take any action.
    However, they will continue to reference old commits (before history rewrite) because they are indexed in Jira database.

  • If you proceed with rewriting history to remove the problematic file(s) and push to your existing repo, another git gc will be needed on the Bitbucket repo for the old references to get removed and for the repo's size to get reduced further. Please let me know and I can run another git gc for that repo.

We have the following feature request to allow users to run a git gc on their remote repo, you can add yourself as a watcher in that request if you'd like to get notified via email on updates:

If you have any questions, please feel free to let me know.

Kind regards,

0 votes
Mikael Sandberg Community Leader Jan 25, 2022

Hi @Salazar Comunicación,

Welcome to Atlassian Community?

Removing the files locally in your repository will not reduce the size, since Git keeps a full history of your repository. If the commit is the last one that you did you have to revert that commit/push. If it is not the last commit you have to remove the file from the history and then push it to Bitbucket. Please have a look at Reduce repository size for instructions on how to solve both scenarios. 

Hi Mikael,

Thank you for your help. The problem is that the commit has a lot of changes and it is not the latest commit, i just need to increase the repository size temporarily to make a new commit and delete that file, but i don't know if someone can help me with that. I have tried other things, but is not working.

Also we did the Undoing the last push, but it seems to didn't affect the size of the repo.

Mikael Sandberg Community Leader Jan 25, 2022

It is not the last commit you will have to rewind your history, either by using git filter-branch or the BFG utility. Have a look a this KB for instructions.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events