Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming master branch to main #31788

Closed
yungsters opened this issue Jun 29, 2021 · 12 comments
Closed

Renaming master branch to main #31788

yungsters opened this issue Jun 29, 2021 · 12 comments
Assignees
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@yungsters
Copy link
Contributor

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.

@yungsters yungsters self-assigned this Jun 29, 2021
@yungsters yungsters pinned this issue Jun 29, 2021
@yungsters
Copy link
Contributor Author

yungsters commented Jun 29, 2021

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

@yungsters
Copy link
Contributor Author

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

@elicwhite
Copy link
Member

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

@ljharb
Copy link

ljharb commented 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.

@yungsters
Copy link
Contributor Author

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.

@yungsters
Copy link
Contributor Author

yungsters commented Jul 15, 2021

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.

@yungsters
Copy link
Contributor Author

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.

@yungsters
Copy link
Contributor Author

facebook-github-bot pushed a commit that referenced this issue Jul 15, 2021
Summary:
Updates documentation in React Native to reference `main` (or `HEAD` for URLs) instead of `master`.

Part of #31788.

Changelog:
[General][Changed] - Update documentation reference from `master` to `main` or `HEAD`.

Reviewed By: JoshuaGross

Differential Revision: D29717128

fbshipit-source-id: 0b0babd8407c6fd3d0e5431f6eaf976059731d6f
facebook-github-bot pushed a commit that referenced this issue Jul 15, 2021
Summary:
Updates documentation in React Native to reference `main` (or `HEAD` for URLs) instead of `master`.

Part of #31788.

Changelog:
[General][Changed] - Update documentation reference from `master` to `main` or `HEAD`.

Reviewed By: JoshuaGross

Differential Revision: D29717128

fbshipit-source-id: 0b0babd8407c6fd3d0e5431f6eaf976059731d6f
@NullPainter2
Copy link

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

@yungsters
Copy link
Contributor Author

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.

@yungsters
Copy link
Contributor Author

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

@NullPainter2

This comment has been minimized.

@facebook facebook locked and limited conversation to collaborators Jul 23, 2021
@yungsters yungsters unpinned this issue Jul 23, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants