question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Renaming `master` branch to `main`

See original GitHub issue

As a part of a broad effort to avoid insensitive terminology in our software, we are renaming our default branch from master to main. We recognize that this is only a small step, but it is an opportunity to make our project and community more welcoming to historically marginalized communities.

How does this impact my development process?

There should be very little impact. GitHub will surface the branch name change in your fork, if you have one. For new forks, you will automatically have main as the default branch.

We encourage the use of feature branches for local development. The only change in practice is changing which branch your feature branch is started from. When sending Pull Requests on GitHub, the target will default to our main branch, so there are no changes to make there.

I have a lot of tools that depend on master being the upstream branch name. How can I fix that?

master has always been only a default value and a number of projects have used other names for their primary development branch for years. We encourage updating your tooling to instead dynamically determine the branch to use. This article provides insight into how you can do that. Additionally, you can always set up a branch locally of any name to track our main branch.

I’d like to do this for my own projects, do you have any documentation on how this works?

GitHub has published a guide documenting their tooling. We recommend reading that and the accompanying documentation.

If you’re a Facebook employee looking to do this for a project you maintain, please reach out to the Open Source Team.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:23
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
ljharbcommented, Jun 29, 2021

Another tip: if you replace “master” in any URL with “HEAD”, github will redirect properly, even if you change to something other than “main” now or in the future.

2reactions
yungsterscommented, Jun 29, 2021

Another tip: if you replace “master” in any URL with “HEAD”, github will redirect properly, even if you change to something other than “main” now or in the future.

Thanks, @ljharb! I will definitely make use of your suggestion for any URLs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to rename the "master" branch to "main" in Git
Renaming "master" to "main" in Tower ... In case you are using the Tower Git client, you can rename branches very easily: After...
Read more >
How to rename the master branch to main - DEV Community ‍ ‍
Change the default branch. Now, at this point you have both master and main on your remote, and before you can delete the...
Read more >
How to rename your "master" branch to "main" - GRRR Tech
From the branches page of your repository, you can rename the branch by clicking the little pencil icon. When renaming your branch, GitHub...
Read more >
Why GitHub renamed its master branch to main | TheServerSide
GitHub renamed the master branch to main for any Git repository, as it addresses cultural change like so many organizations that have nixed ......
Read more >
Renaming the default branch from master - GitHub
Many communities, both on GitHub and in the wider Git community, are considering renaming the default branch name of their repository from master...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found