This repository reached the 2 GB limit, restricting it to read-only access.

Hi,

I recently got the following warning on https://bitbucket.org/igor_gorovoy/pixahub.com

This repository reached the 2 GB limit, restricting it to read-only access.

I then followed the instruction given here to reduce my repository size and restore write access.

I ran the following commands in my corresponding local git repo (which was up-to-date with this one) and ran:

git reset --hard <commit-SHA>

git push --force origin master

But still got error.

2 answers

0 votes

Hi Igor, according to what you said in your message, looks like you were not following the steps exactly as we mention in our documentation. Keep in mind that you need to reset back as many commits as necessary to bring the repo under 2 GB. The way to go here would be:

  1. Obtain a fresh clone of the repo from Bitbucket (always advisable in case something goes wrong).
  2. Do a git reset, as many commits back as needed to make the repo's size go below 2 GB.
    • git reset --hard <some_revision> 
  3. Force push 
    • git push --force

Make sure you have a local backup before try the command above.

Once you pushe the reduced repo to Bitbucket it will remove the read-only limit.  Let us know if you need further assistance! 

Best regards,

Ana

Hi, Ana,

I do next steps, but got same message:


1)   :~/pixahub.com$ git log -n 4
commit b3d59340f42c146cf3a1c08e4c37e610b9ca79c2 (HEAD -> master, origin/master, origin/HEAD)
Author: Igor <igorgorovoy@ukr.net>
Date:   Tue Dec 12 18:20:34 2017 +0200

    - comment eps
    - thumbnail add onclick action

commit d3294b8e4adf1353f2468f4e4f06d0b342acd13e
Merge: def40b3 8df24e4
Author: Igor <igorgorovoy@ukr.net>
Date:   Mon Dec 11 21:54:03 2017 +0200

    Merge remote-tracking branch 'origin/master'

commit 8df24e449849b6fe53f5227c8660502f26a9de59
Author: Vasilij Zakharov <it.zakharov@gmail.com>
Date:   Mon Dec 11 12:24:01 2017 +0200

    EPS processing fix

commit 2a4d5aaa7ed4574c3fdde1b2e8036c534152c814
Author: Vasilij Zakharov <it.zakharov@gmail.com>
Date:   Mon Dec 11 10:22:03 2017 +0200

    .

2):~/pixahub.com$ git reset --hard 8df24e449849b6fe53f5227c8660502f26a9de59
HEAD is now at 8df24e4 EPS processing fix


3):~/pixahub.com$ git push --force
repository is in read only mode (over 2 GB size limit).

Learn how to reduce your repository size: https://confluence.atlassian.com/x/xgMvEw.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


Can you delete in repo on server directory  storage/4upload ?

Thanx.

Best regards,

Igor.

I've run a garbage collection in the remote repository and it went down from 6+GB to 2.1GB. It's still over the limit, but this means that what you're doing is working, you just need to reset back to a previous commit so the repo is back to under 2GB.

Have you tried deleting the repo yourself? You could delete it and then upload the new reduced version. If you can't, let me know (and also confirm you have a copy of it) so I can continue helping you.

Cheers!

Ana

@Igor Gorovoy

I inherited a repository recently that had many unnecessary large binary files committed in the history which caused the repository to be many GB.

The solution I used was to download http://gitextensions.github.io/

Obviously make a local backup copy first.

Open the repository in Git Extensions. Then under the Plugins menu, select 'Find Large Files'.

Check any very large offenders and hit confirm.

You can check the new size by looking at the folder size for the local copy you are working on. Note the history will be re-written and these objects will be gone forever! Needless to say, don't delete anything you will need in the future.

To finalize the changes, do a force push to the origin.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

662 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot