How to disable merging master in release branches?

Bas Prins July 11, 2024

Hi,

We are trying to prevent anybody accidentally pulling master into a release branch. So specifically, we are looking for a way to disable this option.

Now, when we click the release branch, it states something like "28 commits behind "master. Sync now". When we'd accidentally click the sync now button, all commits from master would end up in the release branch, obviously, something we'd never want !

We can't seem to find the setting that disables "syncing with master". We probably overlook the obvious.

Can you kindly tell us how to disable this option for release branches?

3 answers

1 accepted

2 votes
Answer accepted
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 11, 2024

Hi @Bas Prins ,

If the user has write access to the branch, it will have the option to sync. So you need to remove write access on branch restrictions. You can limit the users who have access or only allow merge via pull requests. Users would still be able to create a PR 'main -> release' and merge it, but it is a lot less likely to happen by accident.

If you need greater control, you can use Flowie, a Bitbucket addon we provide, which gives you fine control over the workflow and helps enforcing it. Using Flowie you can disable merge for certain conditions. For instance, in your case, a PR with 'main -> release/*' can never be merged.

Bas Prins July 12, 2024

Aha, that's it. I added myself as people with write access to master. Removing myself from that list indeed grays out the sync now link.

Thx!

0 votes
Nicolas Grossi
Banned
July 11, 2024

@Bas Prins You are right, my bad.

Bas Prins July 11, 2024

Hi @Nicolas Grossi 

That's the other way around I am afraid. That prevents pull requests => master.

We want to prevent pulling master into a release branch.

Or am I missing the point here?

Thx

Bas

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events