solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Change default branch to "main"

Open seand7565 opened this issue 4 years ago • 9 comments

The etymology of the name "master" for the default branch is problematic, but more than that, it's just not very descriptive.

There are a few alternatives, but as this article describes, I think "main" fits much better. It's clearer as to what the purpose of the branch is: image

vs.

image

(even the appropriate definition of master is just the word "main", which to me is a clear indication that we should be using it instead)

I don't think this change is a huge one, and it gets us away from using problematic and unclear terminology. Hearsay on Twitter is that GitHub is considering making this change themselves, though I can't find anything official to back that up.

That being said, for those on cutting edge, this change will be breaking, so we should consider deprecating (if that's even possible?) master branch, or running both master and main branches as copies of each other until a large release like 3.0.

seand7565 avatar Jun 12 '20 18:06 seand7565

I think that this is an issue we should consider and fix.

GitHub is working on some updates to make this easier and painless, you can find more information here. We should probably wait for the new features by GitHub to avoid problems with the migration.

stefano-sarioli avatar Sep 21 '20 12:09 stefano-sarioli

Yeah, that was my thought as well. I'm happy to adopt this new convention, but in the interest of not making extra work for ourselves we can wait until they've rolled out whatever tooling they're planning to make the transition easy/seamless.

jarednorman avatar Sep 22 '20 01:09 jarednorman

If GitHub helps us make that transition smooth, I'm all in favor of this.

aldesantis avatar Sep 22 '20 06:09 aldesantis

Renaming has been made possible a few months ago, and it looks pretty safe, but we should properly assess the practicality of the change.

This is the only risk that I read about:

Although file URLs are automatically redirected, raw file URLs are not redirected. GitHub does not perform any redirects if users perform a git pull for the previous branch name.

ikraamg avatar Apr 16 '21 14:04 ikraamg

Just as a heads up: Rails changed their master branch to main back in February, and as far as I can tell it hasn't caused too much in the way of issues for developers. At least, I haven't heard any complaints since - TBH I wasn't even aware it changed until I looked just now.

seand7565 avatar Apr 16 '21 14:04 seand7565

Yeah, it's been pretty painless in my experience. I've seen a few projects switch to that new default now.

jarednorman avatar Apr 16 '21 17:04 jarednorman

I agree... and even if it could cause some small problem, I think that inclusivity is more important

waiting-for-dev avatar Apr 17 '21 12:04 waiting-for-dev

I think the only annoying thing is we may need to update all the Gemfiles in contrib to use "main" as the default branch. It's currently hardcoded to "master".

jarednorman avatar Sep 14 '21 23:09 jarednorman

Might need to update build matrixes too.

jarednorman avatar Sep 14 '21 23:09 jarednorman