Azure Repos default branch name

Google+ Pinterest LinkedIn Tumblr +
Matt Cooper

Matt

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.

Screenshot of default branch name setting

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.

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.

  Source Link

Share.

Leave A Reply