Proposal: Rename default branch to main #5145
Replies: 7 comments 2 replies
-
IMHO we should just copy Ruby repo standards and discuss overall renaming of all Ruby repos (including std. libs - RubyGems) at https://bugs.ruby-lang.org/. |
Beta Was this translation helpful? Give feedback.
-
Ruby core followed Matz's opinion. I also agreed him. |
Beta Was this translation helpful? Give feedback.
-
I'm in favor of doing this. |
Beta Was this translation helpful? Give feedback.
-
It does affect syncing with ruby-core because current scripts hardcode "master" as the default branch. They would need to be updated to infer the default branch for each repository instead of hardcoding it.
The scripts that generate the changelog will be affected, and also GitHub workflows.
Most likely yes. |
Beta Was this translation helpful? Give feedback.
-
I skimmed through https://github.com/github/renaming and apparently GitHub does this now automatically too 🎉. |
Beta Was this translation helpful? Give feedback.
-
I moved this to a discussion, it fits better here in my opinion. |
Beta Was this translation helpful? Give feedback.
-
I'm also in favor of changing the repo's default branch to Personally, I want Bundler to continue to be an example of current best practices, as much as possible, so I am strongly in favor of making this change. |
Beta Was this translation helpful? Give feedback.
-
Abstract
I wish to propose renaming the default branch from
master
tomain
. 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:
master
tomain
rails/rails#40214This 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 tomain
. 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
andmaster
branches. So that we can test pushing a commit tomain
, while developers continue to usemaster
.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 themaster
branch tomain
and updating the remote toorigin/main
Remove/Rename references to master branch
Update Github actions to remove any branch filtering on the
master
branch and rename any references tomaster
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?
Are any scripts/tooling affected by this proposed change?
Is the workflow in bundler-site affected by this proposed change?
Beta Was this translation helpful? Give feedback.
All reactions