Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-15300

Option to check the `close branch after a PR is merged` checkbox by default

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Moved from: https://jira.atlassian.com/browse/BSERV-10344

      https://devops.stackexchange.com/questions/2649/how-to-close-a-branch-by-default-after-a-pull-request-has-been-merged-in-bitbuck

       


      Latest update from Atlassian 2024-10-04

      Bitbucket Cloud has started work on an option in repo settings (and project settings) that controls the default for "delete source branch after the PR is merged". We'll post an update here when the feature is available.

            [BCLOUD-15300] Option to check the `close branch after a PR is merged` checkbox by default

            Pinned comments

            Hi all 👋 Well I know it's been a long time coming, so I'm happy to say that Bitbucket Cloud has started work on an option in repo settings (and project settings) that controls the default for "delete source branch after the PR is merged". We'll post an update here when the feature is available.

            Dave Parrish [Atlassian] added a comment - Hi all 👋 Well I know it's been a long time coming, so I'm happy to say that Bitbucket Cloud has started work on an option in repo settings (and project settings) that controls the default for "delete source branch after the PR is merged". We'll post an update here when the feature is available.

            All comments

            64a00d9aa858 Not 100%, but strong chance the feature will be available in mid-April.

            Dave Parrish [Atlassian] added a comment - 64a00d9aa858 Not 100%, but strong chance the feature will be available in mid-April.

            Bastin Headmon added a comment -

            dparrish Thanks so much for the update. Much appreciated. Could you please clarify what you mean by ‘soon’? Are we looking at days, weeks, months, or longer?

            Bastin Headmon added a comment - dparrish Thanks so much for the update. Much appreciated. Could you please clarify what you mean by ‘soon’? Are we looking at days, weeks, months, or longer?

            Thanks all for your patience. We did have to pause the project based on other priorities, but it's up and running again and we'll have an update soon. I'm sorry that it's been such a long wait for this feature!

            Dave Parrish [Atlassian] added a comment - Thanks all for your patience. We did have to pause the project based on other priorities, but it's up and running again and we'll have an update soon. I'm sorry that it's been such a long wait for this feature!

            JVDL added a comment -

            For anyone that does not want to wait, I created a userscript that you can install into the GreaseMonkey or TamperMonkey addons in Firefox and Chromium based browsers. If you already have the addon installed, go to https://greasyfork.org/en/scripts/492710-bitbucket-cloud-helper-functions to install or view the source on my GitHub

            JVDL added a comment - For anyone that does not want to wait, I created a userscript that you can install into the GreaseMonkey or TamperMonkey addons in Firefox and Chromium based browsers. If you already have the addon installed, go to https://greasyfork.org/en/scripts/492710-bitbucket-cloud-helper-functions to install or view the source on my GitHub

            dparrish - I'll second Basin's comment -  We've been patiently waiting and MANY in my org would REALLY like this feature to get across the finish line.   

            Steven Dian added a comment - dparrish - I'll second Basin's comment -  We've been patiently waiting and MANY in my org would REALLY like this feature to get across the finish line.   

            dparrish Just checking on the status as the last update was 5 months ago. Is there an ETA on when this feature would be available?

            Bastin Headmon added a comment - dparrish Just checking on the status as the last update was 5 months ago. Is there an ETA on when this feature would be available?

            dparrish 🥲 i never thought this day would come

            Adam Castrucci added a comment - dparrish 🥲 i never thought this day would come

            Hi all 👋 Well I know it's been a long time coming, so I'm happy to say that Bitbucket Cloud has started work on an option in repo settings (and project settings) that controls the default for "delete source branch after the PR is merged". We'll post an update here when the feature is available.

            Dave Parrish [Atlassian] added a comment - Hi all 👋 Well I know it's been a long time coming, so I'm happy to say that Bitbucket Cloud has started work on an option in repo settings (and project settings) that controls the default for "delete source branch after the PR is merged". We'll post an update here when the feature is available.

            +1

            JUAN CARLOS added a comment - +1

            9a412cca67c5 I am not sure anymore if this is just a bummer, if not a disgrace. This item was created 7 years ago. It was already implemented in Bitbucket Server. They moved us to cloud (as they discontinued a Server).

            One would expect that most basic functionality would be eventually moved to the cloud. Especially those that are very highly rated and technical simple (at least should be) as this one.

             

            An explanation from Atlassian product management would be appreciated, what are their thoughts on all this.

            Peter Stegnar added a comment - 9a412cca67c5 I am not sure anymore if this is just a bummer, if not a disgrace. This item was created 7 years ago. It was already implemented in Bitbucket Server. They moved us to cloud (as they discontinued a Server). One would expect that most basic functionality would be eventually moved to the cloud. Especially those that are very highly rated and technical simple (at least should be) as this one.   An explanation from Atlassian product management would be appreciated, what are their thoughts on all this.

            Pleaaase... just migrating to Bitbucket from GitLab. And this basic feature missing is a real bummer.

            Sven Ludwig added a comment - Pleaaase... just migrating to Bitbucket from GitLab. And this basic feature missing is a real bummer.

            Kevin Palm added a comment -

            +1

            Kevin Palm added a comment - +1

            +1

            Github and Gitlab have both supported this feature/configuration since 2019

            Andrew Wasielewski added a comment - Github and Gitlab have both supported this feature/configuration since 2019

            dparrish - Could you please review this request and either assign to someone to work on it or provide us end customers some type of update on when we might expect someone to work on it?   This capability is already enabled in Bitbucket Server as I understand it...  Having the option to set default behaviour to close/delete a branch on a PR merge would be VERY helpful.   Thanks.

            Steven Dian added a comment - dparrish - Could you please review this request and either assign to someone to work on it or provide us end customers some type of update on when we might expect someone to work on it?   This capability is already enabled in Bitbucket Server as I understand it...  Having the option to set default behaviour to close/delete a branch on a PR merge would be VERY helpful.   Thanks.

            sureshy added a comment -

            counting the years....  since 2017. 

            sureshy added a comment - counting the years....  since 2017. 

            Created in 2017...I'm so dumbfounded, I don't know what to say.

            James Pinkster added a comment - Created in 2017...I'm so dumbfounded, I don't know what to say.

            Imagine taking 6+ years to implement a function that is already available in Server version of Bitbucket 

            amir.hosseinbor added a comment - Imagine taking 6+ years to implement a function that is already available in Server version of Bitbucket 

            petre mierlutiu added a comment - - edited

            > We were also on prem BitBucket user and were pushed to the cloud with EOLS of on prem BB.

            Then you might not know that this was actually removed – we were always using the cloud instance and this feature was present in the past.

            > Especially as this would be so helpful for many of us

            But will our companies switch to another product due to this, or other things us simpleton programmers need?

            petre mierlutiu added a comment - - edited > We were also on prem BitBucket user and were pushed to the cloud with EOLS of on prem BB. Then you might not know that this was actually removed – we were always using the cloud instance and this feature was present in the past. > Especially as this would be so helpful for many of us But will our companies switch to another product due to this, or other things us simpleton programmers need?

            @2bbe1d3a083c exactly! Especially as this would be so helpful for many of us (instead we need now purge open branches on our own)! Additionally, this looks like as a nice task for a junior dev. I do not get it.

            We were also on prem BitBucket user and were pushed to the cloud with EOLS of on prem BB.

            Peter Stegnar added a comment - @ 2bbe1d3a083c exactly! Especially as this would be so helpful for many of us (instead we need now purge open branches on our own)! Additionally, this looks like as a nice task for a junior dev. I do not get it. We were also on prem BitBucket user and were pushed to the cloud with EOLS of on prem BB.

            How can you force people to go on Cloud but being 5 years late on basic features...

            Marc-André Goulet added a comment - How can you force people to go on Cloud but being 5 years late on basic features...

            Sam Siner added a comment -

            +1 - please add this feature!

            Sam Siner added a comment - +1 - please add this feature!

            +1

            How is this still not implemented given this was raised in 2017! Please, Please, Please implement this I beg you

            Jimmy Davies added a comment - How is this still not implemented given this was raised in 2017! Please, Please, Please implement this I beg you

            Atlassian PMs: do not implement this feature.

            (reverse psychology)

            Adam Castrucci added a comment - Atlassian PMs: do not implement this feature. (reverse psychology)

            Adding my +1 to the 330 votes and 6 years waiting

            Gerard Howell added a comment - Adding my +1 to the 330 votes and 6 years waiting

            +1

            It can't be that hard, right?

            Michel Petiton added a comment - It can't be that hard, right?

            +1 On this, it's a huge pain point. It would be awesome to have this a configurable default option. Preferably on the Project level so it can inherit down to the repositories inside of a Project.

            Note: It looks like now the language is "Delete (branchname) after the pull request is merged", but the concept is the same.

             

             

            Joshua Yoder added a comment - +1 On this, it's a huge pain point. It would be awesome to have this a configurable default option. Preferably on the Project level so it can inherit down to the repositories inside of a Project. Note: It looks like now the language is "Delete (branchname) after the pull request is merged", but the concept is the same.    

            Not sure why this is not implemented yet but this keeps the branches and the dev to behave.

            I have some repos that contains a good amount of branches and if you go any of those repos branch page it just crashes so that is beneficial to your servers and workload. Only by that cost savings and load on your servers, you should have implemented it by now.

             

            george_pierides added a comment - Not sure why this is not implemented yet but this keeps the branches and the dev to behave. I have some repos that contains a good amount of branches and if you go any of those repos branch page it just crashes so that is beneficial to your servers and workload. Only by that cost savings and load on your servers, you should have implemented it by now.  

            Amun Dhak added a comment -

            +1 - this would improve our experience - developers often skip or miss the checkbox on merge.  The use case for keep branch alive is so edge in our dev strategy, that it almost never happens.  The option to control this setting would improve our software experience.

            Amun Dhak added a comment - +1 - this would improve our experience - developers often skip or miss the checkbox on merge.  The use case for keep branch alive is so edge in our dev strategy, that it almost never happens.  The option to control this setting would improve our software experience.

            Jeffrey Bishop added a comment - - edited

            +1 This would've prevented our branches becoming a huge mess.

            Jeffrey Bishop added a comment - - edited +1 This would've prevented our branches becoming a huge mess.

            +1

            Xaver Gruber added a comment - +1

            +1

            +1

            Kealum Redmond added a comment - +1

            Osmay Cruz added a comment -

            +1

            Osmay Cruz added a comment - +1

            This came up for discussion during our full-team retrospective today. Not being able to have this checkbox checked by default, and only unchecked in the rare cases (probably 2% of the time or less) where we want the branch to continue "living" after the PR for that branch is merged, has pretty big effects on our team.

            It may seem like a small thing, to tell everyone on the team "hey, always remember to check this checkbox when you create a PR!" And by itself, it is a small thing.

            But that's just one feature (of many) of one tool (of many) that we use. Across all the features of all the tools we use, the total effect of all the "hey, remember to do X in tool Y when you are doing Z" things we have to carry around in our heads as workarounds for default behavior that we'd like to happen almost all of the time adds up to a lot of complexity and a lot of opportunities for error.

            As of this comment, this issue has 290 upvotes, and has been an idea around for over 6 years. And it is getting actively, recently commented on and upvoted.

            And it's already in Bitbucket Server but not Bitbucket Cloud.

            Maybe implementing it is more complicated than it seems from the outside (I know that there are things in the product we work on that are sometimes like that). But I hope the Bitbucket Cloud team will consider this improvement soon.

            Scott Moore added a comment - This came up for discussion during our full-team retrospective today. Not being able to have this checkbox checked by default, and only unchecked in the rare cases (probably 2% of the time or less) where we want the branch to continue "living" after the PR for that branch is merged, has pretty big effects on our team. It may seem like a small thing, to tell everyone on the team "hey, always remember to check this checkbox when you create a PR!" And by itself, it is a small thing. But that's just one feature (of many) of one tool (of many) that we use. Across all the features of all the tools we use, the total effect of all the "hey, remember to do X in tool Y when you are doing Z" things we have to carry around in our heads as workarounds for default behavior that we'd like to happen almost all of the time adds up to a lot of complexity and a lot of opportunities for error. As of this comment, this issue has 290 upvotes, and has been an idea around for over 6 years. And it is getting actively, recently commented on and upvoted. And it's already in Bitbucket Server but not Bitbucket Cloud. Maybe implementing it is more complicated than it seems from the outside (I know that there are things in the product we work on that are sometimes like that). But I hope the Bitbucket Cloud team will consider this improvement soon.

            Flowie, our add-on for Bitbucket Cloud, supports this. In addition to setting the default as 'close', you can also enforce the option, even based on specific conditions, e.g., destination branch, so you can implement a workflow without relying on the user.

            It also supports labels, enforced merge strategies, PR size, and much more!

            Saxea _Flowie_ added a comment - Flowie , our add-on for Bitbucket Cloud, supports this. In addition to setting the default as 'close' , you can also enforce the option, even based on specific conditions, e.g., destination branch, so you can implement a workflow without relying on the user. It also supports labels, enforced merge strategies, PR size, and much more!

            Ben Newlin added a comment -

            +1

            Ben Newlin added a comment - +1

            +1

            +1 please !

            Anthony Leroyer added a comment - +1 please !

            +1

            +1

            +1

            Toni Paricio added a comment - +1

            +1

            Dean Kelly added a comment -

            +1

            Dean Kelly added a comment - +1

            +1
            something done in server, but not in cloud. that's a very sad story.

            Tobias Pogadl added a comment - +1 something done in server, but not in cloud. that's a very sad story.

            +1

            Stephen.Ross added a comment - +1

            +1

             

            Bertrand Tukov added a comment - +1  

            +1

            +1

            mcetanas added a comment -

            +1

            mcetanas added a comment - +1

            +1

            ++1000

            Reddysekhar Gaduputi added a comment - ++1000

            +1

            +1

            yoanis added a comment -

            We would love to have this ... before Jan 03, 2028 5:00PM EST

            yoanis added a comment - We would love to have this ... before Jan 03, 2028 5:00PM EST

            Louis Létourneau added a comment - There's also an Atlassian community post about this feature: https://community.atlassian.com/t5/Bitbucket-questions/Delete-source-branch-after-merging-by-DEFAULT/qaq-p/1351244#U2532053

            +1

            jacobamey added a comment -

            +1

            jacobamey added a comment - +1

              dparrish Dave Parrish [Atlassian]
              5accb799bf3f utrecht
              Votes:
              429 Vote for this issue
              Watchers:
              191 Start watching this issue

                Created:
                Updated: