Skip to content

Renaming master branch to main #31788

Closed
Closed

Description

@yungsters

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.

Activity

  1. self-assigned this
    on Jun 29, 2021
  2. pinned this issue on Jun 29, 2021
  3. yungsters commented on Jun 29, 2021

    @yungsters
    ContributorAuthor

    I'll be updating this comment with a list of existing references to master in the React Native repository.

    Additionally, internal Facebook automation tooling will need to be updated.

    • "Code Syncing" Bot
  4. yungsters commented on Jun 29, 2021

    @yungsters
    ContributorAuthor

    Here are Facebook repositories specific to React Native that we will also eventually update.

  5. elicwhite commented on Jun 29, 2021

    @elicwhite
    Contributor

    Are there references in the React Native CLI or releases repo that might need to get updated? Both have scripts that might references the main branch of React Native

  6. ljharb commented on Jun 29, 2021

    @ljharb

    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.

  7. yungsters commented on Jun 29, 2021

    @yungsters
    ContributorAuthor

    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.

  8. yungsters commented on Jul 15, 2021

    @yungsters
    ContributorAuthor

    This is now in progress. The master branch has been renamed to main.

    Contributors will probably want to update local clones following the steps documented here: https://docs.github.com/en/github/administering-a-repository/managing-branches-in-your-repository/renaming-a-branch#updating-a-local-clone-after-a-branch-name-changes

    The bot that syncs code between Facebook's internal repository and GitHub has been paused until all configuration changes have been landed. Then I will re-enable the bot and we'll see what needs attention after that.

  9. yungsters commented on Jul 15, 2021

    @yungsters
    ContributorAuthor

    Actually, contributors will want to just go into the GitHub settings of their fork and rename master to main. Then navigate to your fork and you'll see the commands to run locally to update your fork checkout.

  10. yungsters commented on Jul 15, 2021

    @yungsters
    ContributorAuthor
  11. NullPainter2 commented on Jul 22, 2021

    @NullPainter2

    Do You have a study which proves that "master" vs "main" is an actual problem and not a made up one?

    Also, don't You think that maybe fixing some of thousands of bugs RN has would make it more friendly for new people? Like for example right now RN does not even run in new Xcode :D

  12. yungsters commented on Jul 22, 2021

    @yungsters
    ContributorAuthor

    This change reflects the React Native team's commitment to a respectful and welcoming project for everyone, including underrepresented groups. It is also aligned with changes happening in the Git ecosystem.

    I do acknowledge that we have quite a backlog to work through, and we have plans to make progress there in the coming months. If you are still running into trouble with Xcode 12.5, please take a look at and chime in on #31480.

  13. yungsters commented on Jul 22, 2021

    @yungsters
    ContributorAuthor

    Closing this PR because the branch rename was completed last week.

  14. NullPainter2 commented on Jul 23, 2021

    @NullPainter2
  15. locked and limited conversation to collaborators on Jul 23, 2021
  16. unpinned this issue on Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions