Forums

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

Should I delete merged branches?

Mike Fullmore
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!
June 17, 2020

Hi:

I am new to Bitbucket but not to Git. In my previous jobs we only used local branches and merged into origin/master after approval of our code.

With remote branching I noticed we accumulate a lot of branches that have been merged.

What are best practices on keeping all these branches around? Should I just delete them when merging? Seems like if you want a feature you can just pick the commit out, but branches help group many commits together, etc...

Thoughts?

 

Thanks.

1 answer

1 accepted

1 vote
Answer accepted
ABEL MASILA
Contributor
June 20, 2020

I definitely clean up my branches after they've been merged in.

With bitbucket, the historical information about branches is stored there; I don't need them cluttering my branch list, and when I look at a coworker's fork, ideally I'd like only to see the branches of their current active development. If I'm trying to look at some code on their branch, I want to be able to look through just a few currently active branches, and not every feature or fix they've ever started work on.

The only reason you might have for not deleting a branch post-merge is so you know where a given feature ended, but merge commits (and git merge --no-ff if you really want) make that irrelevant.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events