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

My Repo size exceed 4GB limit and I deleted my wrong remote branch

Le Ni December 19, 2022

Hi dev support.
I have wrong commit that push around 1GB to remote repo and my repo size exceed 4GB limit. I try to fix the commit locally as suport center told but can not force push so I decide to deleted the remote branch contain the oversize commit but nothing change.
Then I try to create branch with same name in remote repo but it seem that repo size not reduce.
Now I can not do anything to fix the problem.

Can anyone help me please.

2 answers

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2022

Hi @Le Ni and welcome to the community!

Yes, I can assist you with this. I can see that your Bitbucket Cloud account has access to quite a few workspaces and repositories. Could you please let me know the last two letters of the repo and the last two letters of the workspace this repo belongs to, so I can identify the one you are talking about, and run a git gc for it?

Kind regards,
Theodora

Le Ni December 20, 2022

@Theodora Boudale Thank you. Because I join so many workspace, the last 4 letters of my workspace is saco and the last 4 letters of my repo is main

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2022

Hi @Le Ni,

Thank you for the info. I ran a git gc for the repository and its size has been reduced. It's under the 4 GB limit now, but still quite large.

Is the large commit still part of the repo's history? If you go to the repo on Bitbucket Cloud website, and then open the Commits page of the repo, do you see the large commit listed there?

Kind regards,
Theodora

Like Le Ni likes this
Le Ni December 20, 2022

Thank you so much for your support. This repo has many of our mistakes, many large commits months ago.

Le Ni December 20, 2022

Those large file is start point of many commits but nearly commits does not has any big size file. I dont know how to reduce the repo size now. Today I add a hundreds MB commits and you did gc but the size not reduce same size as my mistaken commit.

Le Ni December 20, 2022

We do not use these really large file anymore, deleted on our repo but it still living in bitbucket in many branch and I do not know how to remove all of it too

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2022

Hi @Le Ni,

Committing file deletions is not going to remove these files from the repo's history. This is only possible if you rewrite history in the repo, with a tool like BFG.

I made a detailed post about this in a different question:

It's quite long, but I would suggest reading all of it to better understand what you need to take into account. If you have any questions about the content, please feel free to let me know.

A few things that I mention in that post as well:

  • Always take a backup of the repo prior to doing a history rewrite

  • History rewrite will change commit hashes, it's good to communicate this to your team 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 push to the Bitbucket repo after doing a history rewrite, the repo size will probably go up again and the repo will need another git gc. You can let me know here and I can run it again for the repo.

Kind regards,
Theodora

Like Le Ni likes this
Le Ni December 21, 2022

@Theodora Boudale I already try BFG but as you said, the repo size go up and need another git gc. I'll folk this directory to my another workspace today and do BFG one more time. After everything pushed, I'll ask for your help . Thank you again

Le Ni December 22, 2022

@Theodora Boudale I did folk my old repo to another repo, then do BFG tutorial and already push. Can you help me check this repo and run git gc on it.
Workspace last 4 character is saco and repo last characters is main_new

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 23, 2022

Hi @Le Ni,

I ran a git gc on both repositories:

  • Repo with a name ending in main shows on change in size, it is 4 GB
  • Repo with a name ending in main_new now has a reduced size, 2.9 GB

Does only the second repo (main_new) have the changes with BFG?

Please feel free to let me know how you would like us to proceed now:

  • If the fork seems to be in good shape, I can temporarily increase the repo size limit for the main repo, so you can push your changes to that one, please let me know.
  • If you would like to remove more files with BFG from the main_new first, please let me know when you push so I can run another git gc.

Kind regards,
Theodora

Le Ni December 23, 2022

I asked my team to move to folk repo, everything seem good now. Thank for supporting me

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 23, 2022

You are very welcome @Le Ni. If you need anything further, please feel free to reach out!

0 votes
Le Ni December 19, 2022

@Theodora Boudale 
Hi, I saw support help git gc on some project. I dont know how long does it take for a support member to see my disscusstion so I tag you here. Sorry for that

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events