简体   繁体   中英

How to set default branch policies in azure devops

Is it possible to set branch policies across all repo's? In other words, When creating a branch, a default branch policy is already set for master.

Right now you can't. You could listen to events in Azure DevOps for project creation for example and then set the policy yourself. For some information how to start see here: https://docs.microsoft.com/en-us/azure/devops/repos/git/create-pr-status-server-with-azure-functions?view=vsts

Indeed as @Thomas Harris mentioned in the comment above, you can set it for all repos in a single project via

  1. **Project Settings*
  2. Cross-repo policies under "Repos" heading
  3. Click Add branch protection button

And then you can select whether this applies to the default branch or a specific branch name pattern.

通过项目设置设置项目范围的分支保护

It's been changed now. So for others who look for it, you can find it there:

  1. * Project Settings
  2. 'Repositories'
  3. All repositories -> 'Policies' tab
  4. On the bottom there should be 'Branch policies' section with '+' button

Screen from the mentioned view

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM