Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Repository issues

Salazar Comunicación January 25, 2022

Hi

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?

Thanks

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 26, 2022

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: https://jira.atlassian.com/browse/BCLOUD-11593

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

Kind regards,
Theodora

0 votes
Mikael Sandberg
Community Champion
January 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. 

Salazar Comunicación January 25, 2022

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.

Salazar Comunicación January 25, 2022

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

Mikael Sandberg
Community Champion
January 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
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events