-1

Is there a way to restrict users from pushing new branches?

Our management wants the Repo admin to control what branches get created, they don't want devs pushing branches to a repo from their desktops in order to create them.

Is there a way to lock branch creation/pushes? I know you can lock an EXISTING branch, but how about a net new branch a dev pushes to ADS?

torek
  • 448,244
  • 59
  • 642
  • 775
user5855178
  • 567
  • 1
  • 7
  • 17
  • Have you tried to enforce permissions? https://learn.microsoft.com/en-us/azure/devops/repos/git/require-branch-folders?view=azure-devops&tabs=browser#enforce-permissions – Sebastian Siemens Aug 28 '22 at 16:14
  • Most hosting sites do have this as a feature, but each one does it differently, so the generic tag [tag:git] does not apply. – torek Aug 29 '22 at 01:44

1 Answers1

2

Is there a way to lock branch creation/pushes?

To limit users to create new branches, you can set the permission of the users/group.

You can navigate to Project Settings -> Repositories-> Select Repository -> Security and set the permission: Create branch as Deny.

For example:

enter image description here

Then the users will have no access to create/push branch via UI or Git commnad.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28