Missed Team ’24? Catch up on announcements here.

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

Delete source branch after merging by DEFAULT

Daniel Juravski April 16, 2020

Hi,

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

image.png

Thanks!

3 answers

2 votes
JA December 1, 2021

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

Andrey Sitnikov
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!
May 5, 2022

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
hectormartos
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!
January 31, 2023

Our development team was concerned about this in Bitbucket Cloud, so I developed a Chrome extension that automatically checks the checkbox for deleting the branch when merging.

It is Open-Source, and you can download it from the Chrome Web Store.

Like # people like this
Evans Tucker
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!
July 12, 2023

LOL, this is the saddest, most developer-y thing I've read in a while.

 

Come on Atlassian! Get it together. People are already writing their own software to fix this annoying problem!

Like # people like this
flexbox
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!
October 27, 2023

💯

Chris Fouts April 29, 2024

@hectormartos I just now downloaded your Chrome extension in Brave, which is Chrome-based, and restarted my browser. When I initially open a PR, the box is not checked, but if I reload the page, it get's checked.

1 vote
Louis Létourneau
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!
November 13, 2023

As others mentioned, only JS extensions exist for now. A feature request for Bitbucket cloud does exist. You can vote on it.

 

https://jira.atlassian.com/browse/BCLOUD-15300

0 votes
Anton Genkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 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

Don Rolling
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!
August 19, 2021

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
Enrice
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 14, 2022

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.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events