Why does repo size under Repository Details not match the size of .git directory?
Asked by asperry:

I just recently used git-filter-repo to remove large files from my repositories history. I went from over 300 MB to about 1 MB. I force pushed the repository and now when I clone it, I get the smaller (filtered) repository, but on the Bitbucket website under "Repository Details" the size still says over 300 MB. I pushed the filtered repository several days ago. Why does the website still say the size is so large when the size of the cloned repository is clearly much smaller?


Answers:
author: Caroline R
body: Hi, [@asperry](/t5/user/viewprofilepage/user-id/4808849), welcome to the community!

As you confirmed you removed some large files from your repository history and force pushed these changes to your remote repo, I believe the remote still have some dangling commits that need to be removed with a GC. In this case, I can run a GC on the remote repo to remove any dangling commits there, In order to do that, I just need to know the repo name. Could you please share the workspace_ID/repository name masked with asterisks here so I can identify it?

Please feel free to share any additional questions or concerns regarding this case.

Kind regards,   
Caroline

comments: author: asperry
body: That would be great! We're not up against any size limits as far as Bitbucket is concerned so there's no rush if Bitbucket periodically runs GC on some infrequent interval. My question was more based in curiosity and a desire for numbers to agree.

I'm not sure what you mean by sharing the repository name masked with asterisks. Do you mean give a portion of the name but use asterisks for the rest?


author: Caroline R
body: Hi, [@asperry](/t5/user/viewprofilepage/user-id/4808849), yes, this is what I meant :)

Kind regards,   
Caroline


author: asperry
body: I have two repositories that would need GC. They are:

utahtelerobotics/rob\*\*\*\*\*\*\*\*\*\*\*\*\*\* and utahtelerobotics/cap\*\*\*\*\*\*\*\*\*\*\*\*\*\*

In the future, do I need to request GC, or is it something that's done automatically at some interval?

Thanks!


author: Caroline R
body: Hi, [@asperry](/t5/user/viewprofilepage/user-id/4808849),

Thanks for sharing their names. I have run a GC on both repos and removed the existing dangling commits. Could you please confirm if this is the expected size?

Kind regards,   
Caroline


author: asperry
body: Both repositories look good to me now! Thank you so much!


author: Caroline R
body: Awesome, [@asperry](/t5/user/viewprofilepage/user-id/4808849), thanks for your confirmation!

Just to let you know, we have a feature request to allow users to mark repositories for git GC, as you can check here:

* <https://jira.atlassian.com/browse/BCLOUD-11593>

Please consider adding yourself as a watcher to receive the updates as we make progress with this. If you are not familiar with our Feature Request Policy, you can read more about it [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

Kind regards,  
Caroline


author: Jacques Muller
body: [@Caroline R](/t5/user/viewprofilepage/user-id/3934006)   
I need gc run on a repo, how do I go about requesting that.  
I did filter-branch locally and my repo is now as expected. When I clone it it is also as expected but Bitbucket still reflects the initial size.


author: Theodora Boudale
body: Hi [@Jacques Muller](/t5/user/viewprofilepage/user-id/4642905),

Please create a new question in community via <https://community.atlassian.com/t5/forums/postpage/board-id/bitbucket-questions>, and provide the workspace id and repo name ++**masked**++ (with some asterisks and only revealing a few of the letters, so we can identify which repo it is), and we will look into it.

If the repo belongs to a workspace on a paid billing plan you can create a ticket with the support team instead via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product.

Kind regards,  
Theodora


author: Jacques Muller
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)   

Thanks, my issue has been resolved against ticket <https://support.atlassian.com/requests/BBS-196730/>


author: Fabio Racobaldo _Herzum_
body: Hi [@asperry](/t5/user/viewprofilepage/user-id/4808849) ,

welcome to the Atlassian community!

Probably because your large files are in the history of your repo so, even if, they are not in the actual repo , they are in the previous commits yet.

In order to remove large files you need to rewrite repo history, otherwise git just keeps the large file in the history.

Take a look to the following article <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/>

Hope this helps,

Fabio

comments: author: asperry
body: Thank you for your reply, but this does not answer my question. As I mentioned in the original question, I have already changed my repository history using git-filter-repo which is recommended over BFG or filter-branch. The repository that I clone does not contain the large files in the history. My question is why the size given on the Bitbucket website does not reflect that I have reduced the size of the repository by changing the history.


Tags: bitbucket-cloud

cloud