How to push in read-only mode?

kruymbeek July 30, 2017

Hi, 

My bitbucket-repository is too big (> 2GB) so I am now in 'read-only mode'.

Because I want to use my repository, I cleaned (= delete all nonnecessary files) using BFG (https://rtyley.github.io/bfg-repo-cleaner/) which is recommended by Atlassian (see https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html). I used BFG to do the trick and I deleted some of the big unnecessary files, but when I want to do the final step: push the repository back, it says that my repo is too big: 

"remote: repository is in read only mode (over 2 GB size limit).
remote:
remote: Learn how to reduce your repository size: https://confluence.atlassian.com/x/xgMvEw."

How can I clean up  my repository when I can't push anything ?

 I am fighting with it almost 3 weeks so I hope I can get an answer soon (because it starts to frustrate me.

 

9 answers

1 accepted

6 votes
Answer accepted
kruymbeek August 3, 2017

The helpdesk gave me following solution, which was very helpful to me.

 

 
"As this repository is extraordinarily large, you should reset the head of your repository then attempt a force push and let us know how it goes.
 
git reset --hard HEAD~1
git push --force
"
Sheila Cheng June 7, 2019

This does not work for me. Keeps not letting me push anything. I am the admin for the repo.

Vijayaragavan-GKF December 17, 2019

It worked for me. Thanks

2 votes
Stas Horodnianskyi March 18, 2019

Same problem. Using git bash I've undone lots of commits with command $ git reset --hard HEAD~N, but I can't push anything - repository is readonly. How did everyone resolve the issue?

louie camacho March 19, 2019

Dealing with the same issue. Hopefully this comment will bump yours up.

Stas Horodnianskyi March 20, 2019

Hi Louie, I ended up making a request in the help center, they ran GC on my repo and everything worked. 

Like louie camacho likes this
louie camacho March 20, 2019

Thanks, I think my deletion commits worked for me. I moved my large files locally and performed a commit. There was a delay of about 25 mins before it took effect. Hopefully someone sees this and overcome similar issues.

0 votes
FinAdmin October 12, 2020

I am having the same issue, my repo is around 1.7gb in size

0 votes
blair_gemmer July 12, 2019

I'm having the same issue. Our repo: `tomis-data` is over 2GB and I went through the recommendations here to remove the large files and reflog with BFG but everytime I try to `git push` or `git push -f`, it says the repo "is over the size limit and will not accept further additions. Learn how to reduce your repository size: https://confluence.atlassian.com/x/xgMvEw" which is the exact method I used. Any help would be greatly appreciated!

Gennaro Kukonu November 15, 2019

I am having the exact same issue. I have also used BFG to reduce the repo size, but cannot push the changes. The instructions state that I should contact Support to ask for them to execute a "git gc" [garbage collection] on the repo.

 

@Ana Retamal@Ana Retamal

0 votes
alessio harri May 7, 2019

I got the same issue. I need to delete files/folders from a repo that is too large. Do I need to contact the helpdesk?

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2019

Hi @alessio harri ,

You don't need to contact Support for that. If your repo is too large you'll need to fix that on your side following the instructions in the article Reduce repository size. In short, you need to reset back as many commits as necessary to make your repo under 2GB and then force push. 

Let us know if something is not clear!

Best regards,

Ana

tlipska May 14, 2019

What if we need to keep changes since the problem commit?

Like John Bize likes this
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2019

Hi @tlipska , 

Is your local repository over 2GB? You can run the following command in your terminal to find out:

git count-objects -Hv

In that case, I'd advise you to look at your repo and see what's making it so big. If it contains images, binary files, etc then you should consider using Git LFS (Large File Storage) as Git is not a good candidate for storing this kind of files. For more information, you can read Use Git LFS with Bitbucket.

If your local repository is under 2GB, then we can run a garbage collection in the remote to bring it to the right size. Please let us know the name of the repo and we'll do it for you.

Best regards,

Ana

0 votes
tmamiya December 21, 2018

I am also having the same issue.

https://bitbucket.org/tmamiya/n

I have reset to the commit that I want, however can't seem to be able to push it to bitbucket, any help would be appreciated.

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 3, 2019

Hi @tmamiya, sorry for my late response! 

I've checked your account and seems like you have been able to sort it out? If otherwise you still need our assistance let us know and I'll be glad to help you!

Cheers,

Ana

tmamiya January 4, 2019

Hello Ana,

Thanks for the reply yes I was able to sort it out, for future reference was there a official way to solve this issues?

 

Todd-

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2019

Hi @tmamiya, the official instructions are explained in the article Reduce repository size. In short, you need to reset back as many commits as necessary to make your repo under 2GB and then force push.

Have a good day!

Ana

0 votes
inubexdev November 25, 2018

hi i am having same issue anobody help

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 1, 2018

Hi @daniel.gao, I've checked your Bitbucket Cloud account but I couldn't find any repository that was extremely large, the biggest one is around 500 MB. Are you referring to a repo hosted in a different account?

Best regards,

Ana

Fernando Lemler Cani November 8, 2018

Hello Ana,

 

I've been stuck with the same problem.

Got by accident commited some files that are unnecessary, tried to use the BFG, i think it worked, but i can't push the fix.

 

The project is not on my personal account, but on my team.

https://bitbucket.org/livetouchdev/alvoeuaswift

 

The files are:

Tierra Digital Ar.ipa
Tierra Digital Ar.app.dSYM.zip

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2017

Hi! I checked the Bitbucket account associated to your email address but I couldn't find any repo over 2GB in size, are you referring to a different Bitbucket Cloud account? Can you share your username and repo name?

Cheers!

Ana

kruymbeek August 3, 2017

It's OK now. I could fix it thanks to the helpdesk. 

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 2017

Glad to hear it's solved!

daniel.gao October 30, 2018

i've come accross this same question, can't be resolved, please help me ana

POOJA JAISWAL November 27, 2018

I am facing the same issue. how did you fix that? 

Rajani Nitte December 27, 2018

I am also facing the same issue, please help me

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events