-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Abstract
I wish to propose renaming the default branch from master to main. The larger developer community has been moving away from non-inclusive terms such as master, slave, blacklist, whitelist, and I wish for RubyGems & RubyGems.org to do the same.
Other examples of open source projects renaming their default branch main:
- Change the default branch name for new Rails projects from
mastertomainrails/rails#40214 - Change default branch for new Rails projects and plugins to main rails/rails#40254
- https://make.wordpress.org/core/2020/06/18/proposal-update-all-git-repositories-to-use-main-instead-of-master/
This change is relatively minimal thanks to Github natively supporting renaming the default branch to main and will do most of the work for us automatically, such as adding automatic redirects & updating existing Pull Requests to point to main. But this will require some manual steps.
You can find more information at: https://github.com/github/renaming.
Steps Required
As mentioned, Github automates most of the needed steps to switch the default branch to main, but some steps still need to be performed manually by maintainers before & after the rename.
The following list covers steps that to my knowledge are required to do, but may not be indicative of covering everything.
Github Actions
Before renaming the default branch in Github, the Github Action Workflows will need to be amended to mirror the main and master branches. So that we can test pushing a commit to main, while developers continue to use master.
Update branch protection rules
We currently use branch protection to prevent merging Pull Requests that do not pass the status checks. This rule will need to be updated to use main after the default branch changes.
Local Migration
After the rename, developers will need to migrate their local development environment to main. This migration can be done by renaming the master branch to main and updating the remote to origin/main
$ git checkout master
$ git branch -m main
$ git branch -u origin/main
Remove/Rename references to master branch
Update Github actions to remove any branch filtering on the master branch and rename any references to master in the documentation & source code.
Renaming the default branch
The default branch can be renamed in Github, which is documented in doc.github.com
Questions
-
What impacts would this change cause downstream, such as Ruby-src, Truffleruby & JRuby?
- How best do we communicate this change to maintainers?
-
Are any scripts/tooling affected by this proposed change?
-
Is the workflow in bundler-site affected by this proposed change?