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

Hayko Riemenschneider
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!
September 24, 2015

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

1 vote
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2015

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: https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery

http://git-memo.readthedocs.org/en/latest/garbage_collecting.html

1 vote
Nirmal Shankar
Contributor
September 24, 2015

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 https://confluence.atlassian.com/bitbucket/maintaining-a-git-repository-321848291.html

 

0 votes
Hayko Riemenschneider
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!
September 25, 2015

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
TAGS
AUG Leaders

Atlassian Community Events