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
4,299,383
Community Members
 
Community Events
165
Community Groups

Repo size exceeds 4GB, cant push fixes

Edited

Hello,

Same issue here, I ran a bfg clean up to reduce size, and now i'm unable to push the changes because the size is over 4gb, I have the auto gc enabled but still nothing reduced.

Could you check please? the last two letters of the repo are "al"

Best regards

1 answer

0 votes

Hi @Xtend,

I ran a git gc for your repo and although its size has been reduced, it is still over the 4 GB limit.

Since you have reduced the repo's size locally, I have temporarily increased the repo size limit to 5 GB so you can push your changes.

Please note that when you push these changes the repo size will most likely get increased again because the remote repo will contain both old references (prior to history rewrite) and new ones (after history rewrite).

Another git gc will be needed on the remote repo to have the old references removed. Please let me know when you push and I can run another git gc for the repo.

Just a heads up, I moved your post to a new question. It's best to create a new question if you need assistance with a certain issue as a new question will have better visibility to the rest of the Atlassian team if I'm out of office, and also because a post can become difficult to follow if we work on multiple users' issues in that post.

Kind regards,
Theodora

Hello Theodora,
I did the push, you can run the gc again

thanks

Hi @Xtend,

I ran another git gc for the repo, but its size is still over 4 GB.

Could you please let me know

1. What is the output of the following command in the local clone where you executed BFG?

git count-objects -Hv

2. Did you run BFG in a mirror clone of the repo?

3. If you take a mirror clone of the repo now

git clone --mirror <repo url>

and then navigate to the directory of that mirror clone, what is the output of git count-objects -Hv in that directory?

Kind regards,
Theodora

Hi Theodora, 
thank you for your time.

On the mirror clone:

$ git count-objects -Hv
count: 0
size: 0 bytes
in-pack: 35825
packs: 3
size-pack: 4.48 GiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

Hi @Xtend,

Thank you for your reply.

Since the size in the mirror clone shows the repo to be over 4 GB, the push you did earlier did not reduce the remote repo's size.

Please note that I have changed the repo's size limit back to 4 GB.

I would suggest checking this reply of mine to a different post with steps on how to identify large files and reduce the repo's size:

If you use BFG to remove certain files, please make sure that you run it in a mirror clone of your repo, and also that your latest commit is clean with none of the undesired data in it.

Step-by-step instructions for BFG, along with some examples, can be found here:

After you follow all the steps of running BFG, you can check the size of the mirror clone where you ran it with git count-objects -Hv, to confirm if it is below 4 GB.

Please let me know then, and I can temporarily increase the repo size limit again so you can push your changes.

Kind regards,
Theodora

I already did the BFG clean up and it has still more than 4GB...

If I remove all git references manually, the size is 2.6Gb ( you can check the new repo with suffix "_New") it's a copy of the old without ref

Thanks

Hi @Xtend,

Even though I can see the repo's size, I cannot view its content.

A repo's size may be large because it has large/binary files, or because it has a lot of references or a combination of those.

Do you version any large and/or binary files in the repo?

You can use the following command in a clone of the repo to see its files and their respective size:

git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| sed -n 's/^blob //p' \
| sort --numeric-sort --key=2 \
| cut -c 1-12,41- \
| $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest

If you see any large/binary files and you need to version them, then you may want to consider tracking them with Git LFS.

We have the following guide on how to migrate files to Git LFS in an existing repo:

Files tracked with Git LFS do not count towards the repository size, so the repo's size should get reduced.

Git LFS files count towards the workspace's LFS storage.

Workspaces on the free plan have 1 GB of Git LFS, but you can purchase additional LFS storage if you need it. You can find more details on billing plans and the available LFS storage here:

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,239 views 2 9
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you