1
votes

We want only some people to be able to create 'release/*' branch in Azure DevOps cloud(?) repo.

Unfortunately, I couldn’t find this option in UI. I also couldn’t find it here https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops and here https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-permissions?view=azure-devops

I tried to implement it with REST API but my attempts were unsuccessful. I also didn’t find any extension which could help me with this.

I'm still looking for a solution.

1
Have you reviewed this already? docs.microsoft.com/en-us/azure/devops/repos/git/…Matt
Hi @Alexandr Tymoschuk. I am afraid it is not supported to set branch security by Rest api yet. You can vote it up on this user voice. You might have to use tf git permission command as workaround. See below answerLevi Lu-MSFT

1 Answers

1
votes

There is not option in the UI to set the create branch permission for branches.

However, you can achieve this by runing tf git permission commands in Developer Command Prompt for Visual Studio to deny the permission to create branches under releases. See below example:

Below command will block the users in Contributors group creating branches under releases

tf git permission /deny:CreateBranch /group:[MyProject]\Contributors /collection:https://dev.azure.com/MyOrganiza/ /teamproject:MyProject /repository:myRepo /branch:releases

Check Git Permission Command for more information.