Kristófer Reykjalín

I'm changing the default branch name in my git repositories, and you should too

Published on June 25, 2020.

There’s been a bit of an uproar in the software development community because it’s been brought to everyone’s attention that the default branch naming convention of master in git isn’t exactly appropriate.

This was first brought to my attention at work with a link to a post from Scott Hanselman about renaming your default git branch in response to the IETF pointing out that the master-slave terminology is both “inappropriate and arcane” as well as “technically and historically inaccurate”.

Many teams at work have decided to change the default branch names in their repositories, and I’m pretty sure that will end up being a company-wide change. Even GitHub is planning to change the default branch to main.

Having thought about this for a while I wholeheartedly agree with this decision, and I will be changing the default branch names in my own repositories to main.

But before we go any further let’s take a look at what the actual problem with the status quo is.

What’s the problem with master?

As far as I’ve been able to gather, the origin of the default branch name in git comes from a different version control system called BitKeeper. BitKeeper’s naming convention is based on the master-slave relationship.

This is problematic because of the racist subtext inherent in that metaphor, the historical context of which should never be forgotten.

The use of such terms [racist language] does not merely reflect a racist culture, but also serves to legitimize and perpetuate it.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6148600/

I think it’s pretty safe to say that no one intends to legitimize and perpetuate racism, but just by using the language you become part of the problem, no matter whether that’s intentional or not.

I have no interest in being part of a community that accepts and encourages racist language—and racism by proxy—and neither should you.

So how do we address this?

The first thing we as a community need to do is recognize that there’s a problem here. Only then can we start to work our way through the issue, and come up with and implement solutions.

In this particular case the solution is easy. Just change the default branch name in your repositories. Stop using master-slave terminology. Try your best to stop using racist language in your day-to-day life, accidental or otherwise.

This will, of course, take a bit of getting used to, but I’m 100% sure that’s something everyone will get over quickly.

main, primary, default, production, leader, active are all reasonable alternatives. Having thought on this a bit I’d argue that main, primary, and default all describe the general purpose of the default branch much better than master ever can. Those terms don’t rely on metaphors; they describe the actual function.

The IETF has more suggestions that are appropriate in other contexts.

Counter-arguments

In my opinion, all of the arguments against this change ignore the fact that there exist better alternatives that describe the function of the default branch in a much better way than master can.

They also seem to ignore that this change is small, and will only need a slight adjustment on your part. For people that already find the master branch offensive this will be a huge change for the better.

Weighing those two against each other should make the choice obvious. The tiny bit of discomfort this will be for you is entirely worth the gain this will be for someone else.

But let’s discuss some of the actual counter-arguments I’ve seen floating around.

Many tools rely on master as the default branch

No, they probably don’t. I’ve seen people say this, and this worried me too. However, I’ve yet to see a tool that breaks when the default branch isn’t master.

Let’s all be honest here. If the tool breaks when you change the default branch, it frankly needs a lot more work, and you probably shouldn’t be using it for your super important project.

The master branch isn’t related to slavery, but a “master copy” from the recording industry

At this point the origin of the term no longer matters. Even if the master-slave metaphor wasn’t the original intent behind the phrasing, the fact of the matter is that the metaphor is now associated with the master branch naming convention.

Avoiding the use of master will only give more meaning to the racist undertones of the word

Here’s a newsflash for you: the word is already associated with racism. Using the word will not neutralize that association.

Try applying this reasoning to other racially charged words, especially ones that are already widely accepted to be racist. Is this really an argument you want to make?

Changing the branch name won’t change society

No, it probably won’t. But then again, that’s not the point of the change.

Language and terminology with offensive subtexts directly affects people’s perception of the content. As such, we shouldn’t be using language with offensive subtexts. It’s that simple.

Complex and subtle configurations of sexist, racist, or ethnocentric language use in technical documents can derail or interfere with readers’ ability and desire to comprehend and follow important information.

https://doi.org/10.1080/10572259809364639 (emphasis mine)

The point of this change is to make the software development community more welcoming to all, no matter what their background is.

If changing the default branch name will make even one person feel more welcomed and comfortable, then the change will have been worth it.

Final words

This small change could make someone’s day. It could make them ecstatic. This might be something that’s been causing them discomfort for a long time. Think about that someone. Isn’t a bit of temporary discomfort a tiny price to pay for that someone’s happiness?

Do the right thing.

Be the change you wish to see in the world.

We but mirror the world. All the tendencies present in the outer world are to be found in the world of our body. If we could change ourselves, the tendencies in the world would also change. As a man changes his own nature, so does the attitude of the world change towards him. This is the divine mystery supreme. A wonderful thing it is and the source of our happiness. We need not wait to see what others do.

Mahatma Gandhi