I want to enforce a specific policy on my master
branch. In VSTS how to lock master branch so that no one can commit to it but pull requests from other branches can be merged?
Make changes on master
branch only through pull request, you should set branch policies for master
branch.
And you can find how branch policy works as below:
Protect this branch
Setting a Required policy will enforce the use of pull requests when updating the branch
Setting a Required policy will prevent branch deletion
Manage permissions for this branch on the Security page
You can set the items for how to protect master
branch. Such as below picture requires at least one reviewer for pull request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With