Skip to content

You can set default branch name for new repositories in Azure DevOps

Reading Time: 2 minutes

In this post I want to point out that you can set default branch name for new repositories in Azure DevOps. So that more people are aware that it can be done.

Now there are various reasons why you would do this which I discussed in a previous post. One of the most important being about the recent controversy surrounding the alleged origin of the master branch naming convention.

Which has highlighted the desire for inclusive terminology to be used more. With this in mind, this has now been added to Azure DevOps.

If you have the right permissions you can do this yourself in Azure DevOps. In fact, if you want to test first you can create your own Azure DevOps organization. Which you can read how to do in detail here.

How

It’s easy to do this in your Azure DevOps project if you have the right permission. First you need to go into your project Settings as per the below image.

Afterwards, select the ‘Repositories’ section as below.

Once you are in the ‘Repositories’ section click the ‘Settings’ option. As you can see below it’s then easy to change your default branch name.

You can set default branch name for new repositories in Azure DevOps
My preferred branch name is main

Something to remember is that if you go back and change your default branch name for existing repositories you can have issues. You can read how to resolve some of these in a previous post of mine here.

Final word

As you can see you can set default branch name for new repositories in Azure DevOps easily yourself if you have the right permissions.

I only discovered this myself the other day and want to spread awareness about it. Because in reality this got introduced in Azure DevOps on August 3rd as part of sprint 173 by Microsoft. Which you can read in detail here.

Published inAzure DevOps

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *