Starting a couple months (?) ago, GitHub started creating new repositories with a
main branch instead of the usual
master branch. The move supposedly helps reduce discrimination in the tech industry and avoids the negative association with slavery.
Now, this blog post isn’t aiming to debate whether the change is effective at preventing such discrimination or association - there’s plenty of dicussion to be had there, and to be quite honest, I don’t think I’m qualified to make such an assessment. What we can do here, though, is talk about how the change is really confusing to developers, and why I think this entire politically-correct motivation is misplaced.
git checkout master
Muscle memory is a fascinating thing. Whenever I finish up my work on a feature branch, I commit changes, then switch over to the master - oh wait. We can’t use that anymore.
Sure, in the future, we’d get used to the extra ten seconds of keying up, deleting
master, and typing in
main. But will we?
In the future, we will still have repositories that have
master branches instead of
main branches. If I’m conditioned to use the
main branch, the exact same thing will happen, but in reverse. I’ll type in
git checkout main,
git will chastise me, and I’ll scream as I type in
git branch to figure out why it’s not working and realize they’re using
master instead of
And yes, this will be common. Why?
git still uses master
Open up your terminal and type
git init. Then type
master branch instead of
So when will developers flock over to
git’s repository to demand the change? I got curious and looked it up. Apparently, a change was made in July 2020 to allow for default branch names. So yes, you can technically go through the
git config hoops and change the name from
main, but that only affects your repositories.
And many repositories do too
Here are all the repositories on GitHub that use
master instead of
main (as of writing this blog post):
- apple/(some repositories, such as foundationdb)
- microsoft/(some repositories, such as pxt-arcade)
- …and much much more. These are just the ones I found in a random search.
Some companies, such as Microsoft or Apple, have already started transitioning some repositories to
main, but not all of them.
Honest opinion: I’m fine with master
Whenever I think of a
master branch, I don’t think of a master/slave relationship that is being purported as a reasoning for this change. I think of the term “master recording” in the music industry - as in, the original recording of a song. The
master branch is just that - a branch where original, long-term development happens and new branches are spun off of the master branch to add more features.
This is more apparent, as
git doesn’t really have a concept of “slave” branches. I’ve never, ever heard of people refer to a feature branch as a “slave” branch.
Quite honestly? I think this entire issue stems from people not understanding that there are multiple definitions to a word. Yes, direct from the Merriam-Webster dictionary:
2. d. (2) : an owner especially of a slave or animal
is definitely a definition for the term “master.” But so is:
5. b. an original from which copies can be made
which is exactly what I described above with the
master branch. In
git, branches don’t “own” other branches! The first definition doesn’t even fit!
I get it. Being politically correct is important to some folks, and I understand why. It’s great to make others feel welcome by using inclusive terms. But trying to be politically correct with a misunderstanding of the term just causes more harm than it prevents. It’s like petitioning to universities to stop using the term “masters degree,” or asking MasterCard to rename themselves to MainCard.
And besides, there’s are terms used in computing that are actually connected to the slave practices in history: the terms master/slave in the IDE standard. We didn’t have any outrage back then, so why do we have outrage now over a completely unrelated definition of the term “master?”
It’s 2021, whatever
It seems like the
main transition is here to stay on GitHub. Sure. Fine. Just one more step when cloning a repository to check the master branch name.
I just hope that no more terms get “canceled” like this. We developers have enough to memorize as-is.
If you want to learn more about this change, Wired has a great article about it. I agree that the terms “empty symbolism” and “performative activisim” perfectly describe the problems with forcing politically correct language in places where it’s uncalled for.