Reputation: 3
As main branch is always the default branch in my repositories, when I create a pull request the default branch to merge into is main.
Without paying attention, I can merge a feature branch to main, bypassing Dev and UAT branches.
I unfortunately didn't find the solution to define a specific branch allowed to merge to another specific branch.
I would like the following rules applied :
Only UAT can be merge to main
Only Dev can be merge to UAT
Upvotes: 0
Views: 448
Reputation: 13944
In Azure DevOps, GitHub and GitLab, when setting Branch Protection Policies, there is no available option to limit which branches can merge to the protected branches. So, you demands is not supported currently.
If you really need this feature, I recommend you try to report a feature request on the platform where your Git repositories are in.
If you Git repositories are in Azure DevOps, you can report the feature request on Developer Community. That will make it more convenient for the product teams to receive and understand your ideas. And your feedback also could be helpful for improving the Azure DevOps products.
Upvotes: 1