Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In VSTS how to lock master branch so that no one can commit to it but pull requests from other branches can be merged?

Tags:

azure-devops

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?

like image 289
tRuEsAtM Avatar asked Dec 13 '17 01:12

tRuEsAtM


1 Answers

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.

enter image description here

like image 196
Marina Liu Avatar answered Nov 09 '22 06:11

Marina Liu