Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,380
Community Members
 
Community Events
168
Community Groups

Delete source branch after merging by DEFAULT

Hi,

Any way/add-on/workaround to tick the 'Delete source branch after merging' by default on every merge window?

image.png

Thanks!

2 answers

For Bitbucket Server you can set this up on a project-level under Settings > Branches (under the Workflow section), scroll to the bottom and change the default 'Branch deletion on merge' setting on and press save

 

PqhKj

Does anybody now if that option is available or will be implemented for Bitbucket Cloud? Couldn't find it there with my not premium account.

Like # people like this
0 votes
Anton Genkin Atlassian Team Apr 23, 2020

@Daniel Juravski there is no global setting that changes the default state of this checkbox. The state of the checkbox is saved per user/repository. For example, if you choose to delete branch after merge in repository ABC, on next merge the checkbox will be checked.

If you still need to have this checkbox checked by default, here are a few options:

  1. Try JS script - https://github.com/acharlop/bitbucket-close-pr-default 
  2. Use a script for ScriptRunner for Bitbucket - Link
  3. Automate deletion of merged branches using CI

 

If you could tell us more about your use-case that would be great - BSERV-9254

I would appreciate having it checked by default because I often forget to check it. Our teams tend to forget it as well and this has lead to use having a lot of dead branches that we have to clean up. They're not that hard to clean up, but they really pile up. This would be much easier if the box was checked by default. Thank you!

Like # people like this

This is misleading. The "default" only is a default as long as the user never has merged in that repository.

I would expect a default to be the default on each subsequent merge. The state should not be remembered.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events