Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Clarification Regarding Workspace Storage Usage

dolphins_devteam
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 11, 2025

Dear BitBucket Support Team,

I recently received a notification stating that “Your workspace is over 1 GB – please take action now.”. I'm currently reviewing the projects under my account and noticed something that I'd like to clarify with your help.

In particular, the repository `<redacted>` is reported in the Bitbucket UI to be using 959.77 MB. However, when I clone this repository locally, it takes up significantly less space - around 444 MB, as shown by the `du -sm` command, and 465.1 MB on disk according to Finder’s “Get Info”.

Here are the commands I ran to verify this:

>git clone <repo_url>
Cloning into 'repo-name'...
remote: Enumerating objects: 71533, done.
remote: Counting objects: 100% (6396/6396), done.
remote: Compressing objects: 100% (4641/4641), done.
remote: Total 71533 (delta 5161), reused 2015 (delta 1751), pack-reused 65137 (from 1)
Receiving objects: 100% (71533/71533), 317.85 MiB | 6.89 MiB/s, done.
Resolving deltas: 100% (50734/50734), done.

>du -sm repo-name
444 repo-name

Could you help me understand:
1. Why the repository size shown in BitBucket is significantly larger than the actual local clone?
2. Is this due to Git history, pack files, or something else stored in the remote?
3. Are there any recommended steps I can take to reduce the size of this repository on BitBucket’s side?

Thank you for your time and support.

Best regards,
Yakiv

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.
April 14, 2025

Hi Yakiv and welcome to the community!

I cannot access the contents of your remote repo, but I believe that there may be unreferenced objects in the remote (e.g. from deleted branches) that haven't been cleared or that the automated garbage collection didn't pack the objects very efficiently.

I triggered a git gc that should pack the repo more efficiently and the repo's size has been reduced to 308.9 MB.

Does it look ok now on your end?

Users cannot trigger a git gc on their remote repos, but you can can create a question in community if you would ever like us to run it for a certain repo of yours.

Please keep in mind that the steps you followed are not a very accurate way to verify differences in size and you will almost always get a different number, for the following reasons:

  • A regular clone will only fetch the repo's main branch locally. If your Bitbucket repo has more than one branch, then the commits of these additional branches won't exist in the clone unless the branches are fetched locally.
  • A regular clone has a working directory, so the du command will also include the size of the working directory. A Bitbucket repo doesn't have a working directory, it's a bare repo.

What you can do is:

1. Take a mirror clone of the repo with the command

git clone --mirror <repo_url>

This will be a bare repo with all the history and no working directory.

2. Then, navigate to the directory of the mirror clone and run the command

git count-objects -Hv

The sum of the fields size and size-pack in the output will show you the repo's size and you can use that to compare with the size displayed in Bitbucket.

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

Please feel free to reach out if you have any questions!

Kind regards,
Theodora

dolphins_devteam
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 14, 2025

Hi Theodora,


Thank you so much for your help!

I really appreciate you running the `git gc` - the repo size looks much better now on my end. Your explanation about why my method for checking the size wasn't accurate was very helpful and clarified a lot for me.

Also, thanks for taking the extra step to remove the repo details from my post to protect my privacy. That was very thoughtful.

Really appreciate your support! 


Best regards,
Yakiv

Like Theodora Boudale likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 15, 2025

You are very welcome, Yakiv! I'm glad to have helped.

Please feel free to reach out if you ever need anything else!

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events