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

Cannot reduce repository size after exceeding 2GB limit

Jeff Mangum August 31, 2021

Hello,

I have exceeded the 2GB limit on my bitbucket repo and have followed the directions provided to try to reduce it.  All has been unsuccessful as the repo is not reduced in size.  Note that:

(1) I have the Labs garbage collection feature turned-on.

(2) I tried the following to clear-out the repo history:

  1. rm -rf .git
  2. git init
  3. git add .
  4. git commit -m “Removed history”
  5. git remote add origin <repo_url_removed>
  6. git push -u –force origin master

(3) When I check the size of the repo remotely, I see that it is not over 2GB:

git count-objects -Hv
count: 8
size: 164.00 KiB
in-pack: 482
packs: 1
size-pack: 16.41 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

 

I have had this problem before, and the solution was for a sysadmin to run a garbage collection on the repo.  Perhaps this is what needs to be done this time.  Thank you for your assistance.

-- Jeff

 

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 1, 2021

Hi Jeff and welcome to the community!

I ran a git gc on the repo and its size is 22.8 MB now.

Regarding the Labs feature and why it didn't work:

(1) At the moment we don't enforce the 2 GB limit on repos owned by workspaces on the Free plan (see here).
This means that all repos have a 4 GB limit at this time, so the Labs feature will work if a repo goes over 4 GB.

(2) If a repo is over the limit and the Labs feature is enabled, you'll need to undo the last commit with a git reset and push that, you can see more details here.

Just a heads up, I removed the repo URL from your post to protect your privacy.

Please feel free to let me know if things are ok now and if you need anything further!

Kind regards,
Theodora

Jeff Mangum September 1, 2021

Thank you Theodora. I still don't understand why my attempts to garbage collect failed, though.  I did the following several times:

git gc --aggressive --prune=all

...with no success.

-- Jeff

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2021

Hi Jeff,

You are very welcome.

If you run a git gc locally in a clone of your repo, the cleanup runs in that clone on your machine. It doesn't run in the Bitbucket repo which is hosted on our servers.

I hope this helps to clarify things, please feel free to let me know if you have any other questions.

Kind regards,
Theodora

Jeff Mangum September 4, 2021

ok.  I ran the git gc locally on the master.  Would be nice if there was a way to clean-up one's repo without having to ask for sysadmin-level help.

-- Jeff

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events