https://about.gitlab.com/blog/2021/03/10/new-git-default-branch-name/ Get free trial * Product Gitlab cogs icon svg GitLab Professional Services Accelerate your software lifecycle with help from GitLab experts Popular GitLab use cases Enterprise Small Business Continuous Integration (CI/CD) Source Code Management (SCM) Out-of-the-box Pipelines (Auto DevOps) Security (DevSecOps) Agile Development Value Stream Management GitOps * Pricing * Resources All-Remote Community Get Started Upcoming Events Is GitLab any good? Customer Case Studies 2020 Developer Survey Topics GitLab docs * Blog * Partners * Support Contact Support Licensing and Subscriptions Caring for Customers Support Resources Partners Channel Partners * Install GitLab * Explore * Sign in * Get free trial Gitlab x icon svg * Product Gitlab cogs icon svg GitLab Professional Services Accelerate your software lifecycle with help from GitLab experts Popular GitLab use cases Enterprise Small Business Continuous Integration (CI/CD) Source Code Management (SCM) Out-of-the-box Pipelines (Auto DevOps) Security (DevSecOps) Agile Development Value Stream Management GitOps * Pricing * Resources All-Remote Community Get Started Upcoming Events Is GitLab any good? Customer Case Studies 2020 Developer Survey Topics GitLab docs * Blog * Partners * Support Contact Support Licensing and Subscriptions Caring for Customers Support Resources Partners Channel Partners * Install GitLab * Explore * Sign in * Get free trial [ ] - Back to news Mar 10, 2021 - Daniel Gruesso The new Git default branch name Why we're joining the Git community and updating "master" to "main". Every Git repository has an initial branch, which is the first branch to be created when a new repository is generated. Historically, the default name for this initial branch was master. This term came from Bitkeeper, a predecessor to Git. Bitkeeper referred to the source of truth as the "master repository" and other copies as "slave repositories". This shows how common master/slave references have been in technology, and the difficulty in knowing how the term master should be interpreted. The Git project maintainers, in coordination with the broader community, have been listening to the development community's feedback on determining a more descriptive and inclusive name for the default branch and offering users options to change the name of the default branch name (usually master) of their repository. There have already been significant steps toward this goal: * Git 2.28.0, released in July 2020, introduced the init.defaultBranch configuration option, which allows Git users to define and configure a default branch name other than master. In June 2020, the Software Freedom Conservancy released a statement summarizing why the default term master is offensive to many users because of its history. * Git maintainers are actively working toward a permanent change for the default name from master to main. You can read more about this change on this post from the Git mailing list. A large part of this effort involves updating all existing tests in the Git project. GitLab has already introduced changes that allow users to change the default branch name both at the instance-level (for self-managed users) and at the group-level (for both SaaS and self-managed users). To further align with the community, we will make the following changes in the upcoming releases: 1. Default branch name changes for GitLab.com and self-managed users : When creating a new project in GitLab, the default branch name will change from master to main. We are planning to implement this change in two phases: + Phase 1: We plan to update GitLab's underlying Git version to 2.31.0 as part of GitLab's 13.11 release, shipping on April 22, 2021. The branch name change will be shipped under a feature flag. Projects created from GitLab will continue to the current default branch name of master. + Phase 2: We will remove the feature flag as part for our next major release 14.0, shipping on May 22, 2021. Any project created in GitLab will use the default branch name of main. + Action required: When upgrading a self-managed instance to GitLab 14.0, new projects created via the GitLab GUI will use main as the default branch name. If your project is running CI/CD jobs configured in another project, hard-coded references to master will need to be updated to use either main or to use a default branch name CI/CD variable, such as CI_DEFAULT_BRANCH. You can continue to use master by configuring a custom default branch name. 2. Default branch name change for the GitLab project (and its related projects): The GitLab project and its related projects will change their default branch name from master to main. Some projects have already been updated (for example GitLab Shell) and we plan to update the rest between now and the release of 14.0 on May 22, 2021. + Action required: If during the switchover you created a contribution for the GitLab project and are still using the master branch locally, you will need to rebase your changes prior to pushing to consume the new default branch name of main. Please note this will but only affect new projects created in GitLab. Existing projects will not be affected. You can learn more about the change in the default branch rename epic. We welcome the use of main as a more inclusive default branch name and are happy to see that our peers at GitHub and Atlassian also support this change. Free eBook: A beginner's guide to GitOps GitOps takes DevOps processes and applies them to infrastructure automation. See a sample GitOps workflow and learn how to get started with GitOps. Download now [arrow] Git's default branch name is changing. What you need to know. via @danielgruesso Click to tweet! * Git Share on Facebook Share on Twitter Share on LinkedIn * Previous Post: How to write a more thoughtful code review * Next Post: 5 Ways to level up your remote engineering ... More Posts Like This: GitLab solicits input on its plans to de-identify service usage data To better protect our users' data, we are building our own internal system that de-identifies userIDs and other personal information prior to being moved into our internal analytics environment. Learn more How to use GitLab with GKE Autopilot GitLab works out of the box with the new GKE Autopilot from Google Cloud, a managed variant of the popular Google Kubernetes Engine. Learn more A new era of Kubernetes integrations on GitLab.com The GitLab Kubernetes Agent enables secure deployments from GitLab SaaS to your Kubernetes cluster and provides deep integrations of your cluster to GitLab. Learn more Follow us: Sign up for GitLab's twice-monthly newsletter to explore upcoming webcasts, how-to blogs, and stay up-to-date on exciting new features released every month: Thanks for subscribing! Try all GitLab features - free for 30 days GitLab is more than just source code management or CI/CD. It is a full software development lifecycle & DevOps tool in a single application. Try GitLab Free * Twitter * Facebook * YouTube * LinkedIn Why GitLab? * Product * Solutions * Services * DevOps lifecycle * DevOps tools * Is it any good? * Releases * Pricing * Get started Resources * All resources * All-Remote * Blog * Newsletter * Events * Webcasts * Topics * Training * Docs * Install Community * Customers * Contribute * Community Programs * Direction * Technology Partners * Channel Partners * Open Source Partners * GitLab for Open Source * GitLab for Education * GitLab for Startups * Shop * Community Forum Support * Get help * Contact Sales * Contact Support * Support options * Status * Customers Portal Company * About * What is GitLab? * Jobs * Culture * Team * Press * Analysts * Handbook * Security * Contact * Terms * Privacy * Trademark Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license View page source -- Edit in Web IDE -- please contribute. Creative Commons License Try GitLab risk-free for 30 days. No credit card required. Have questions? Contact us. Get Your Free Trial Today Gitlab x icon svg