All of my public repositories now use a "main" branch instead of
"master". ("master" still exists and will be bumped along with "main"
for a while, so I won't break existing repo clones of you guys. I'll put
up blog posts before that happens.)
If you have cloned a repo of mine and want to switch to the new branch,
either clone the repo afresh or run the following steps:
$ git checkout master
$ git branch -m main
$ git fetch
$ git branch -u origin/main
$ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
An overview on why this is happening:
<
https://git.github.io/rev_news/2020/07/29/edition-65/>
Summary:
"master" in Git does not refer to a "master/slave model"; something like
that simply does not exist in Git. It didn't even inherit a
"master/slave" connotation from Bitkeeper. It was always meant as "the
main thing" or "the original thing", as in "master recording".
Still, it is a bad choice of words. When we're talking about Git, we're
talking about a decentralized version control system -- something that
very well could employ a "master/slave model". Git's "master" is very
misleading in that regard.
Plus, it's not a great name anyway. It's not like the term "master" is a
precise description of what this branch is used for. From where I'm
standing, the "master" branch always was "the main branch of
development", so "main" is indeed a much better name for it.
In upstream Git, preparations are being made to change the default
branch name for new repositories from "master" to "main":
<
https://github.com/git/git/blob/master/Documentation/RelNotes/2.30.0.txt#L127>
So you better get used to it anyway.
(And it really isn't a big deal. Stop the drama. "main" is a good name,
let's use it.)