A Clockwork Engineer
Wildcard For Azure Devops Branch Policies
We use GitFlow as our branching model on Azure Devops. When we create a new Release branch, we want it to be protected by default. By protection I mean, preventing unreviewed code changes.
This is not like setting a branch policy for an existing branch, it would be a wildcard for future branches. You need to do one extra step to access the correct page for a wildcard and this is not documented yet.
- Go to Branches page under Repos on Azure Devops.
- If you already have a folder in your repo, you can skip to step 5.
- Click New branch and fil in the name like release/tempBranch.
- Click Create.
-
Click ⋮ (vertical ellipsis) next to a folder.
- Select Branch policies in the menu.
- It will redirect to the branch policies page with the title Branch policies for {folderName}/*.
- Here you can set the policies.
- After setting the policies in place you can remove the tempBranch if you created one.
The existing or future branches which matches the wildcard will be using the policies.