How do i clean a bitbucket git branch after deleting it?

So I have had three branches, master, test1, test2. Someone did something silly, and now test1 includes 1.4 gbyte of binary files. Ok, we dont need branch test1 anymore, so i go ahead and delete it from the Bitbucket gui interface for deleting branches. Branch is gone, but the whole repository is still 1.4 gbyte large. How do I clean that? The branch is gone...

3 answers

What can usually happen with git repo is when we just delete something, the actual files would be in the repo.

This would be a good read


When you delete a branch, the commits on it are still present until they eventually get cleaned up (usually 30 days).  If you're lucky, this may fix itself in a little bit of time.

You could also potentially clone the repo down, fix it using plumbing commands, delete the remote copy, and push your local copy back up making a new clean copy.


Look at this:

Thanks! I've tried the "Garbage collecting dead data" from the maintaining info, but woah, dudes. It's 2015. Why do I have to take care of stuff I deleted? The other options dont work for me, because my branch is already gone in all ways I know how to see it. Yet the garbage collection didn't work.

Second, ok in about a week it'll be 30 days since this first occurred. Let's see what happens. Otherwise I just create a new repository and forget all old one...

thanks for your hints!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

314 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you