How to prevent merging of one branch to another

Is there a way to prevent merging of one branch to another. We have branches like 15-maint 16-maint master, we merge forward from 15-maint to 16-maint and also from 16-maint to master but never from 16-maint to 15-maint or from master to 16-maint. Sometimes due to human error, of the person merging, higher branch is merged to lower - like 16-maint to 15-maint or master to 16-maint. Is there any way to prevent this by means of hooks or configs in Bitbucket ?

1 answer

0 vote

Hi Bopanna

You can use branch level permissions and a branch naming convention to limit who has the capability to merge. Take a look at the documentation available at https://confluence.atlassian.com/display/BitbucketServer/Using+branch+permissions

Cheers

Bhushan

@Bhushan Nagaraj : Thankyou for the documentation link. But It does not provide the option to achieve what I am asking...

@b bopanna would you please elaborate why branch permissions won't work for you? 

@Ulrich Kuhnhardt [Izymes]: There are 4 restrictions available :

i. Prevent all changes

ii. Prevent deletion

iii. Prevent rewriting history

iv. Prevent changes without a pull request

Now how can I use these to configure my lower branches to not allow merges from higher ? (do not permit merge of master to 16-maint while allowing merging of 15-maint to 16-maint ?)

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,554 views 26 12
Join discussion

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