Setting wild card branch policies in @VSTS

10 Mar 2018

Source Control. Git VSTS / TFS

I’ve probably mentioned it before but keeping up with what’s happening with VSTS is incredible hard with their 3 week cadence and generally huge set of features each 3 weeks. This week at MVP Summit I had what I thought would be a cool request to allow wild card branch policies. I was thinking of writing a console app to do this but thought it would be interesting to ask the product group as it’s part of the many benefits of being a MVP Smile.

The Ask

So the ask is that instead of each time I create a new branch I need to set the branch policies I want to be able to set what the policies are before those branches are created. So basically I would create a branch for release/* branches and then never worry that the policy is not set in the future.

The Solution

As with many other productivity requests I generally have to the individual PM’s I was told by Jeremy Epling that this already exists today. Seems I missed another great feature in VSTS Smile with tongue out. To get started you need to make sure you have a branch under the folder you would like to set the policy, this could mean you create a temporary branch just to set the branch policy.

Once created you can

  1. Click on the ellipse on the folder and then
  2. Branch policies


and then you can set the policies for any branches created under this folder, you should notice the /* in the branch name that you are setting the policies for


Once you change the policy you are able to delete the temp branch that has been created and any new branches in this path will automatically inherit the policies created


There is a lot of great functionality in VSTS and sometimes if you not following what’s going on properly in the product you just have to try the experience you would like and might find it exists already.

Hope this helps others Open-mouthed smile