Azure Repos now offers a customizable default branch name for Git which can be set per project or per organization.
Today we talk about the default branch name in Azure Repos and how to change it. Let's see how.
If you are a visual learner, or simply prefer to watch and listen instead of reading, here you have the video with the whole explanation and demo, which to be fair is much more complete than this post.
If you rather prefer reading, well... let's just continue :)
To change the default branch name for new repositories you have 2 options: you can do it either at project-level or at organization-level.
To change it at project level, you need to go into
Project Settings > Repositories > Settings
Remember that this will set the new default branch name only on newly created repos inside this project.
If you want to change the default branch for an existing repo, just go to:
Repos > Branches > Create or select a branch > ... > Set as default
This is good, but if you have many projects in your Azure DevOps organization it will take you forever to change this. This is where the new org-level settings comes in help.
To change the default branch name for new repositories at org level go into
Org Settings > Repositories > Settings
Now all your new repos will have the default branch name as you set here.
You can still change the name at project level if you want, and that will override the setting at organization-level.
Let me know in the comment section below what is your default branch name of choice.