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".
https://confluence.atlassian.com/bitbucketserver045/using-bitbucket-server/controlling-access-to-code/using-branch-permissions
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?
https://stackoverflow.com/questions/43368651/git-only-allow-merge-from-development-into-master