Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

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

Unable to reduce repo size in Bitbucket after cleaning up

Ajay Singh October 24, 2024

Hi All, 

I made few commits to a branch that contained some large files. The files were removed in some of the latest commits. The branch was then merged with another branch - dev via Pull Requests (only a couple of them). Recently, I checked the repo size in Bitbucket and it showed an increase in size due to large files. 

I came across few articles on how to tackle this problem. So, I cleaned up the local branches using git filter-branch. That removed the offending commits and large files. I could see the size of repo decreased drastically on local. Then I force pushed the impacted branches having those commit refs to Bitbucket. 

But the repo size in Bitbucket has not decreased. Furthermore, When I searched the using commit hash, I could still find the dangling commits those showed an error like this - 

This commit is not reachable from any branch or tag in this repository. It may be from a fork outside of this repository.

 

The issue looks quite similar to - https://community.atlassian.com/t5/Bitbucket-questions/This-commit-is-not-reachable-from-any-branch-or-tag-in-this/qaq-p/2703261

Also, to do another test (My bad!), I created a brand new branch locally having large file in the commit and pushed it to Bitbucket. This increased the size of repo as expected. Then I deleted the branch from Bitbucket Remote cloud expecting this will cleanup the commit refs contained in the branch (No Pull request was created). However, it did not and I ended up with one more dangling commit. 

 

Could anyone please help in reducing the size of repo and doing the cleanup? I have tried multiple things but it did not work.

 

Thanks!

2 answers

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.
October 28, 2024

Hi Ajay and welcome to the community!

Your Bitbucket Cloud account has access to several repositories and I need to know which is the affected repo so that I can run a git gc on it.

Can you please provide the repo name masked? When I say masked I mean like this:

ab****cd****efg

with some asterisks masking some of the characters in the repo's name. Then, I can identify it from the ones you have access to.

Kind regards,
Theodora

Ajay Singh October 28, 2024

Hi Theodora, 

Please see below the masked repo name - 

i***-**r*i*e

 

Please let me know if that helps.

Regards, 

Ajay

Ajay Singh October 28, 2024

Hi Theodora, 

Please see below the masked repo name that needs cleaning - 

i***-*e**i*e

 

Regards, 

Ajay

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2024

Hi Ajay,

Thank you for the details. I ran a git gc on the repo and its size has been reduced. Does the new size agree with your local repo's size?

If the large files were part of certain PRs, it is possible that they are still referenced by these PRs. Then, the only way to get these PR refs removed would be to have the affected PRs deleted by the support team. We would need a support ticket in order to check PR refs and possibly delete them (if you agree with this).

If you would like the support team to check, you can create a ticket via https://support.atlassian.com/contact/#/; in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. When you are asked to provide the workspace URL, please make sure you enter the URL of the workspace that is on a paid billing plan to proceed with ticket creation.

Please feel free to let me know if you have any questions!

Kind regards,
Theodora

Ajay Singh October 28, 2024

Hi Theodora, 

Thank you for running the cleanup. It has indeed reduced the size. But as you said it can be reduced further by removing certain PRs. I will check internally with the team and will raise a support ticket with PR details if needed to reduce the repo size further. I will update this thread soon with my comments.

Can you please let me know is there any other way apart from reaching out to the Bitbucket team when there is a need of reducing repo size e.g. Automatic run of git gc, force pushing branches etc.? 

Thank you, 

Ajay

 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2024

Hi Ajay,

You are very welcome. You can also a raise a ticket with the support team to ask for a list of PRs with the largest refs so that you discuss with the team whether you want to delete these specific PRs or not.

A git gc runs on every push to the repo, but with different parameters depending on many different conditions. If the automated git gc doesn't reduce your repo's size enough, you will need to reach out either here or via a support ticket so that we manually run it.

Kind regards,
Theodora

Ajay Singh October 29, 2024

Hi Theodora, 

Thank you for the details. This helps.  

Regards, 

Ajay

 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2024

You are very welcome, Ajay. Please feel free to reach out if you need anything else!

Like Ajay Singh likes this
0 votes
Ajay Singh October 28, 2024

Hi, 


Can anyone from Bitbucket team please help on this one?

 

Thank you

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events