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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Only allow merge from branch UAT into master

Problem: Right now we are working with a total of four environments and we have one branch per environment: develop, QA, UAT and master (production). We also have an extra branch based on our current release number that we work against. 

Our current work flow requires a pull request for each branch using branch permission "Prevent changes without a pull request".

This is proving quite cumbersome since new code will have to go through five pull requests to reach master. Even if it is fast to approve since all code should already be approved in the later stages it is a major overhead. To get something into development is two pull requests, one from release branch 1.2.3 and one to develop for example. 

What we would like to do is require a pull request to our release branch (1.2.3) and that only the release branch is allowed to be merged into development, without requiring a pull request. It should then only be possible to merge develop into QA etc. 

I read about a server-side pre-receive hook on StackOverflow but I'm unsure how this could be implemented on Bitbucket Server. Has anyone done anything like this?

1 answer

0 votes
Jimmy Seddon Community Leader Apr 18, 2019

Hi Oscar,

I personlly haven't tried that as our branching model is different than what you have described.  If you are finding your branching model cumbersome, may I suggest taking a look at this as an alternative branching strategy.  It reduces the number of pull requests and might help simplify things for you:

I hope this helps!


Hello James,

Thanks for your input. We have been looking at this approach but nothing is decided yet. Would like to have it like the question describes before a new branching model is in place. 


Hi Oscar

Did you manage to find an answer to your question?  I am currently going through a proof of concept to move our code to Bitbucket.  We currently have a model on our version control system where we move code from development to system testing to user acceptance testing to production.  I am looking to replicate this on Bitbucket but am unsure of the best approach.  Any advice or suggestions would be helpful.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,937 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you