Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protecting a git branch in Visual Studio Team Services

I would like only explicitly permitted developers to merge into a 'master' branch. I've found the location of the security settings but nothing seems to allow me to say 'that branch, only allow Rob to merge into it'. Any specific guidance please?

like image 213
Rob Avatar asked Jan 25 '15 07:01

Rob


People also ask

How do I lock a branch in TFS?

Locate your branch on the Branches view. You can search for your branch using the Search all branches box in the upper right. Lock the branch by selecting the ... icon next to the branch name and then selecting Lock from the menu.


1 Answers

You can protect MASTER in VSTS pretty easily as TFS provides enterprise Git capabilities. There are two ways to achieve this.

1) Git Branch Permissions

In the administration pages under the Version Control tab you can change permission for each published branch. You need to maintain access at the repo level, however on MASTER you can change "Contributor" commit permission to "not configured". You can then add only Rob...

VSTS Git Branch permissions

Oh... Always use "not set" rather than "deny" as deny always overrides.

2) Git Branch Policies

VSTS has introduces the idea of Branch Policies. These Branch Policies can be applied to any branch but are traditionally applied to MASTER.

VSTS Git Branch Policies

Here you can apply multiple policies to reflect you needs... I always set

like image 128
MrHinsh - Martin Hinshelwood Avatar answered Oct 10 '22 03:10

MrHinsh - Martin Hinshelwood