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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I reduced my repo size but bitbucket's size has increased, what can I do?

Hello,

My initial repo size was 1.68GB. I followed the steps described here https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/ - and reduced it using BFG.

Now bitbucket shows my repo size as 1.71GB (which is larger).

However, when I clone it again the folder size on my computer is 861.9MB.

And running git count-objects -Hv gives me:
count: 0
size: 0 bytes
in-pack: 23767
packs: 1
size-pack: 793.95 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

what can I do?

1 answer

1 accepted

1 vote
Answer accepted
Ana Retamal Atlassian Team Aug 03, 2020

Hi @FerFrassia, thanks for reaching out!

I've run git gc in your remote repository and the size has decreased to 792.1 MB. It's normal that this happens from time to time, Bitbucket has automated gc that happen in the background for this reason. 

When you push changes to your repository, any objects that become orphan are not immediately deleted. Let's say you amended a commit by changing all of its files and pushed the new version – in that case the previous version of that commit (commit object, tree object and blob objects for every file) becomes loose and can be deleted. However, for the sake of performance Git just inserts the new objects and doesn't always delete the old objects straight away. Instead, it runs the so-called garbage collection from time to time, which is a mechanism to identify loose objects and delete them.

Normally garbage collection is triggered automatically when you push commits to your repository, however it doesn't happen on every push because GC is potentially quite expensive operation, especially when the repository becomes large. Our Git configuration has some heuristics around when and what kind of GC to trigger (it has several levels of "aggressiveness").

Under normal circumstances, any loose objects will eventually be deleted as long as you keep working on the repository by making new pushes. But for some time Bitbucket would show a larger repository size than it actually is. 

Hope that explains why it happened! 

Have a good day,

Ana

Like Ana Retamal likes this
Ana Retamal Atlassian Team Aug 04, 2020

You're welcome! If you need anything else in the future, let us know :)

Suggest an answer

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,087 views 0 7
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