Search code examples
azure-devopsazure-pipelinesrepoazure-repos

Azure DevOps Server Repos


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?


Solution

  • 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.