'How to set default branch policies for future branches in Azure Devops

I want to lock release branches from merging anything. Adding a default branch policy is fine as well. I can do it for any existing branch but not future branches. Is there a way to set default branch policies?



Solution 1:[1]

I was trying to find a solution for future repos as well. Turns out there are cross-repo policies :)

Goto:

Settings > All Repos > Policies (tab) > scroll down to add new policies (you can add wildcards too :) )

Actually took me a while to find. Maybe it helps someone.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 markus