Automatically delete branch after merging a pull request

When I click "Merge" in a pull request, a dialog gives me the option to delete the source branch: 

image2016-10-4 17:28:43.png

I realise this is "sticky" – Bitbucket will remember what I ticked last time. However, it's easy to untick the box and then forget to tick it again and, before you know it, there are dozens of old branches cluttering the project. Is there any way to:

  • Enable this checkbox for everyone by default – no longer make it "sticky"?
  • Delete all branches for which the associated pull request is merged, and is 0 commits ahead of master branch?
  • Solve my problem another way?

Thanks.

2 answers

I'd also like to know if there is something that could be done to set a default for this checkbox: either checked (my preference) or not (for the branch hoarders), and set for either a "project" (my preference) or per repo (in case some folks really really don't like it – "fine, go work in your repo over there" wink)

The ability to turn this off and on in the settings would be helpful. We use Vincent Driessen's git branching model, and I do NOT need my dev branch to be deleted when I merge it into stage, or stage into prod.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

696 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot