Many communities are considering renaming the default branch of their repository away from master
. Azure DevOps customers are no exception. We’re committed to making the renaming process as seamless as possible for project owners and contributors.
We’re joining the Git project (statement, code change) and multiple vendors including GitHub in delivering these changes. As an industry, we’re making an effort to move towards more inclusive language.
What’s changing and what’s not
- ✅ We’ve added the ability to choose the initial branch name for new repositories. If you don’t choose, you’ll get a default defined by Azure DevOps as a fall-back.
- ✅ We’ve published advice for existing repositories.
- 🚫 We’re not changing the default branch for any existing repositories. That could be highly disruptive and unexpected. You have to do this yourself (if you want to).
Each of these are discussed in detail below.
Your choice of initial branches
Beginning with this sprint’s deployment, folks with Edit policies at the project level may choose the name of the initial branch for new repositories in that project. The setting won’t change anything for existing, populated repositories. It will change the first branch created when you click New repository or when you initialize an empty repository.
(Edited!) Coming in S176, we’ll add an organization-level setting as well.
What if you don’t enable this setting?
You’ll fall through to a default defined by Azure DevOps. Today, that default is master
. Later this year, the default will switch to main
. We plan to make the switch in early September. Edited: we will make this switch sometime in October 2020, after the org-level setting ships.
What if I want to switch to main
immediately?
You don’t have to wait for us to change our default. You can turn on this feature and set main
(or whatever default you want) today.
What if I want to keep using master
?
If you prefer not to change, you should enable this feature and set master
as your preferred branch name. Then, when the default changes to main
, your repositories will continue to use master
.
Advice for existing repositories
Before you change existing repositories, you need to consider downstream impacts. Among those impacts are:
- Pipelines
- Existing pull requests
- Existing clones
- Incoming links
We’ve put together guidance on changing the default branch name. It covers each of these topics in more detail and provides instructions for making the change. As we learn more (and hear feedback from you), we’ll keep that topic updated.
Should I change?
If you can, yes. This is the direction Git and the ecosystem are headed for the long term. That said, Git has defaulted to master
for a very long time. Tools and processes have sprung up which may assume the name of the default branch.
In particular, where there’s an existing repo, the disruption of changing branch names may be a large burden. Also, it can be confusing and fight muscle memory for those working in multiple repos with different default branches. Consider all the guidance and then decide whether, when, and how your organization can absorb the change.
Feedback welcomed
If there’s anything we missed, or ways we could make this easier, please let us know in the comments or on Developer Community.
Is there a REST api to toggle this feature on or off?
The setting is project-wide. When I create a new project, it’s created with one default repository. How do I keep the current behavior (default master branch) for project’s default repositories and for all future projects?
The repo created in a new project is empty. If you populate it from the Azure Repos interface, it’ll be subject to whatever setting you define for the project. (If you push from a local repo, it will inherit whatever default branch that repo defines – just as Azure Repos always has.)
I've gone looking for a devops organizational wide setting default setting for this that will apply automatically to all new repos in all new projects created going forward but there doesn't seem to be one. Am i missing something? Are we going to have to remember to set a default branch name for new repos for every new project that we create so that the branch name is "master"? Is this default...
We’ll add an organization level setting as well. The way org and project settings interact requires more thought and care, so we opted to ship the project setting quickly / first. Thanks for the feedback.
Thanks Matt – much appreciated!
Ha ha. I could not see more stupid thing than this
Ä° don’t get it, why? What’s wrong with “master” as a default?
Scott Hanselman covers it pretty well.
Scott is a great speaker and technologist. I have to say one one of my favourites. What bothers me is what happens if we don't change from master? What is the implication? Does that imply you are a racist? Does it mean that you are insensitive? Has this term been labelled as hate speech somewhere? Is there some petition or lobby group that asked for this to be changed? Considering the social cost of this,...
Thanks for engaging in a constructive way. These are fair questions.
As the post indicates and I'll emphasize again: there are real costs to changing, especially in existing repos. It's truly a choice. This tweet frames it pretty concisely, in my opinion. Azure DevOps has several repos which we can't change anytime soon because of this cost-benefit tradeoff. For new work, it's zero impact on us, and we'll leave the new default in place on...
Inclusiveness?
What are the stats? How many people were excluded previously? How many people felt prevented from being able to use AzureDevOps repos due to the lack of this feature?
I would be surprised if it was more people than are offended and feel 'excluded' by this sort of PC SJW nonsense.
And what about the people who find 'main' offensive? What about them, eh? Eh? I mean, the derivations of that word...
Thanks for this change. Those who can’t tolerate change are only a small bump in the road of progress.
can’t tolerate changes?
more like can’t tolerate changes that don’t make anything better in any meaningful way apart from satisfying someone’s ego 🙂 leave alone potentially breaking existing tools
SJWs win again, unfortunately
Im fine with making an option to change the default but git is leaving the default to master so please don’t change the eventual default to main as it will break stuff and cause fragmentation to those who want to stay consistent.
Also, I agree that why is this being added when there are higher priority issues that have been voted on. Vscode santa hat all over again.
Oh FFS! Most idiotic feature that literally most of the community never even asked…
Way to bloat things with useless stuff.
SMH…
The world has gone mad. If we have got to a point where the word ‘master’ has become offensive then seriously, what is the point? Its all about context, all about context. But hey, lets jump on that band wagon and enjoy the ride. Oh…did i say ride? Sorry to offend….yawn.