{"id":59496,"date":"2020-08-06T06:03:44","date_gmt":"2020-08-06T14:03:44","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/devops\/?p=59496"},"modified":"2020-09-17T05:01:29","modified_gmt":"2020-09-17T13:01:29","slug":"azure-repos-default-branch-name","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/azure-repos-default-branch-name\/","title":{"rendered":"Azure Repos default branch name"},"content":{"rendered":"<p>Many communities are considering renaming the default branch of their repository away from <code>master<\/code>. Azure DevOps customers <a href=\"https:\/\/developercommunity.visualstudio.com\/idea\/1077145\/globally-rename-master-branches.html\">are no exception<\/a>. We&#8217;re committed to making the renaming process as seamless as possible for project owners and contributors.<\/p>\n<p>We&#8217;re joining the Git project (<a href=\"https:\/\/sfconservancy.org\/news\/2020\/jun\/23\/gitbranchname\/\">statement<\/a>, <a href=\"https:\/\/lore.kernel.org\/git\/pull.656.v4.git.1593009996.gitgitgadget@gmail.com\/\">code change<\/a>) and multiple vendors <a href=\"https:\/\/github.com\/github\/renaming\">including GitHub<\/a> in delivering these changes. As an industry, we&#8217;re making an effort to move towards more inclusive language.<\/p>\n<h2>What&#8217;s changing and what&#8217;s not<\/h2>\n<ul>\n<li>\u2705 We&#8217;ve added the ability to <a href=\"#initial-branches\">choose the initial branch name<\/a> for new repositories. If you don&#8217;t choose, you&#8217;ll get a default defined by Azure DevOps as a fall-back.<\/li>\n<li>\u2705 We&#8217;ve published <a href=\"#advice\">advice for existing repositories<\/a>.<\/li>\n<li>\ud83d\udeab We&#8217;re <strong>not<\/strong> changing the default branch for any existing repositories. That could be highly disruptive and unexpected. You have to do this yourself (<a href=\"#should-i-change\">if you want to<\/a>).<\/li>\n<\/ul>\n<p>Each of these are discussed in detail below.<\/p>\n<h2 id=\"initial-branches\">Your choice of initial branches<\/h2>\n<p>Beginning with this sprint&#8217;s deployment, folks with <strong>Edit policies<\/strong> at the project level may choose the name of the initial branch for new repositories in that project. The setting won&#8217;t change anything for existing, populated repositories. It will change the first branch created when you click <strong>New repository<\/strong> or when you initialize an empty repository.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2020\/08\/default-branch-setting.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2020\/08\/default-branch-setting.png\" alt=\"Screenshot of default branch name setting\" width=\"974\" height=\"856\" class=\"alignnone size-full wp-image-59500\" srcset=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2020\/08\/default-branch-setting.png 974w, https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2020\/08\/default-branch-setting-300x264.png 300w, https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2020\/08\/default-branch-setting-768x675.png 768w\" sizes=\"(max-width: 974px) 100vw, 974px\" \/><\/a><\/p>\n<p>(Edited!) Coming in S176, we&#8217;ll add an organization-level setting as well.<\/p>\n<h3>What if you don&#8217;t enable this setting?<\/h3>\n<p>You&#8217;ll fall through to a default defined by Azure DevOps. Today, that default is <code>master<\/code>. Later this year, the default will switch to <code>main<\/code>. <del datetime=\"2020-09-17T12:58:27+00:00\">We plan to make the switch in early September.<\/del> Edited: we will make this switch sometime in October 2020, after the org-level setting ships.<\/p>\n<h3>What if I want to switch to <code>main<\/code> immediately?<\/h3>\n<p>You don&#8217;t have to wait for us to change our default. You can turn on this feature and set <code>main<\/code> (or whatever default you want) today.<\/p>\n<h3>What if I want to keep using <code>master<\/code>?<\/h3>\n<p>If you prefer not to change, you should enable this feature and set <code>master<\/code> as your preferred branch name. Then, when the default changes to <code>main<\/code>, your repositories will continue to use <code>master<\/code>.<\/p>\n<h2 id=\"advice\">Advice for existing repositories<\/h2>\n<p>Before you change existing repositories, you need to consider downstream impacts. Among those impacts are:<\/p>\n<ul>\n<li>Pipelines<\/li>\n<li>Existing pull requests<\/li>\n<li>Existing clones<\/li>\n<li>Incoming links<\/li>\n<\/ul>\n<p>We&#8217;ve put together guidance on <a href=\"https:\/\/docs.microsoft.com\/azure\/devops\/repos\/git\/change-default-branch\">changing the default branch name<\/a>. It covers each of these topics in more detail and provides instructions for making the change. As we learn more (and hear <a href=\"#feedback\">feedback from you<\/a>), we&#8217;ll keep that topic updated.<\/p>\n<h2 id=\"should-i-change\">Should I change?<\/h2>\n<p>If you can, yes. This is the direction Git and the ecosystem are headed for the long term. That said, Git has defaulted to <code>master<\/code> for a very long time. Tools and processes have sprung up which may assume the name of the default branch.<\/p>\n<p>In particular, where there&#8217;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.<\/p>\n<h2 id=\"feedback\">Feedback welcomed<\/h2>\n<p>If there&#8217;s anything we missed, or ways we could make this easier, please let us know in the comments or on <a href=\"https:\/\/developercommunity.visualstudio.com\/spaces\/21\/index.html\">Developer Community<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure Repos added the ability to choose a default branch for new repositories.<\/p>\n","protected":false},"author":719,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[225],"tags":[],"class_list":["post-59496","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git"],"acf":[],"blog_post_summary":"<p>Azure Repos added the ability to choose a default branch for new repositories.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/59496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/719"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=59496"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/59496\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=59496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=59496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=59496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}