loading...
Cover image for Replacing master with main in Github

Replacing master with main in Github

afrodevgirl profile image Alexis Moody ・2 min read

As a black software engineer I have often felt uncomfortable with a variety of terms used throughout the industry. Terms like master/slave, blacklist/whitelist, and black hat/white hat enforce this country's belief that white is good and black is not. We can and should be better than this.

I am the product of slaves and sharecroppers from Louisiana/Tennessee so using the term master to define the default source of truth in my repos has always caused me pain. But I got used to it because it was such a pervasive term, and every time I brought up how hurtful it was to coworkers I was met with resistance. I refuse to do so any longer. Today, I have begun the process of moving to the use of main as my default branch in all of my owned repos. So i'm here to show you how to make a change that will take 3 minutes or less and make your teams more inclusive.

Step 1 - Update Local

While on the master branch input the following:

$ git branch -m master main
$ git push -u origin main

So what are we doing here? First with the -m command we are moving the git history from master to a new branch called main. Next we're pushing the main branch up to the origin remote, and establishing an upstream connection with the -u command.

Step 2 - Update Repo

  • Navigate to your repository > Settings > Branches
  • Select main as your default branch
  • Update your branch protection rules
  • Navigate to Code > Branches and delete master

That's literally it. I hope this guide helps you and your teams become more inclusive!

Posted on by:

afrodevgirl profile

Alexis Moody

@afrodevgirl

I'm a full stack engineer passionate about building products that change user's lives.

Discussion

pic
Editor guide
 

Hi Alexis.

I cannot understand why so many people are resisting this change.
Scott Tolinski found the rights word on Twitter:



So true.

Thanks for sharing the steps necessary for the change in a short and crisp way. I'm totally on board with this. All the newer repositories and the ones I'm working in regularly are updated already. All other repositories I own will be updated bit by bit.

 

What I think is most interesting is that when we say "but that's the way we've always done it" we are saying what people in 'the establishment' usually say.

In IT we are happy to disrupt industries causing all kinds of pain to people in 'the establishment' who have 'always done it the old way', yet when someone tries to disrupt us we cry foul.

At some point we moved from taking down 'the man' to actually becoming 'the man'.

You can't have it both ways - complaining when others don't change, then complaining that you don't want to change.

 
 

I'm seriously stunned by how many people are fighting this! The number of folks who I've seen comment for the first time on DEV just to argue against this change is super discouraging.

 

I'm 100% with you. It's just sad.

 

I disagree with the change for three main reasons:

  1. Force of habit

Yes, I know it's not the best one, but that's how pretty much everyone that disagrees feels. I've been using master since 2012 when I learned git, and I still use it every day. Deployed projects on Netlify or AWS use master, and those in VPS as well. When switching to main, I will be struggling for a while.

In addition, every online tutorial that wasn't published or updated after this change will be outdated, making it confusing for beginners. Is it master? It it main? They'll have to figure it out. Not just for them, but also for the projects they will be contributing to.

  1. The precedent

Right now, nobody who uses the word master in a git context is referring to slavery. But this will set a precedent if main becomes the standard. People who use master in 5-10 years will be accused of racism, by at least some minority, since everyone else will be using "main" because "master" is viewed as racist. Repositories will have issues demanding to rename the "master" to "main", and arguments will happen. That will also make black folks uncomfortable when contributing to projects with the "master" branch. It will increase a polarization already happening in the tech community.

  1. Is it really worth it?

So after #1 and #2, is worth the change?
If you were to ask black folks what are the problems that they're facing in the industry, I don't think the word "master" in git would come up in their top 10 list. Are we avoiding the long, complicated solutions and doing this just to show we're doing something?

Github still has a contract with ICE and has banned people based on their nationality.

Are we paying attention? Or did they make us happy already?

(please notice I'm not white, I don't live in a first world country and english is not my first language, so that might explain why I'm wrong/wasn't clear on something - no bad intentions here)

 

Hi Luis.

  1. As you stated yourself "Force of habit" is not a real argument. "We have always done it that way" is killing every healthy discussion at its core.

  2. Just because nobody is referring to slavery while using the term master in the context of git, doesn't make the origin of the word disappear. If you ask me, I will happily do this change if more people will feel more comfortable and welcome.

  3. in my opinion, we should be able to do smaller changes like this while we tackle the big issues in other places.

Sloan, the sloth mascot Comment marked as low quality/non-constructive by the community View code of conduct

The origin of the word? Oh you mean "master craftsman", don't you, or maybe "masters degree"? Oh but you don't, you just assume it means slave master, because you want to.

Hi Janne. Thank you for your comment. But, to be honest, I doubt that the branch name originates from "Master degree". I think it's also unlikely that "Master craftsman" is the real origin.
Bastien Nocera answered the question, why the name has a reference to "master/slave" here: mail.gnome.org/archives/desktop-de...

But it would be really cool if you could provide some proof that it originates from "Master degree". That would shorten this debate for sure.

I honestly don't much care if it's a "master copy" or from Bitkeeper's "master" and "slave" repository -concept, and really the only person who likely knows for sure where it came from is Linus Torvalds. When you say "answered" you mean "speculated".

  1. Master-slave relationships in computing are used to pretty accurately describe exactly what is going on. In case of version control "master" is just a bad name because it's non-descriptive and random, but it wouldn't be the first thing Git has failed at naming in a clear and useful way. Does not mean it is racist.

  2. The word "master" is not purely related to slavery, even though people want to assume that because it fits their narrative. Using master lists, having a master plan, having a blacklist, being a white hat, or wearing a white shirt are all equally racist words, not at all.

Definitions for the word master

  1. I would assume only someone from the U.S., or someone completely ignorant of the world history, could equate slavery as purely a racist issue. I would recommend to more rooted in the modern day reality of economic/wage slavery, and working against that, than the imagined threats of referencing slavery in the relatively recent U.S. history.

Whatever the origin of the word (of which you've only assumed that you know it - not given any proof), it's not a race issue. It's still a bad word that confuses people needlessly and a better name like "default" or e.g. "main" should have always been the right choice. Unfortunately Torvalds makes bad decisions on a regular basis and nobody dares to question him on those because there's some cult of personality thing going on around him.

 

Have you already spent more time defending it, than it would take to switch?

I think killing a man takes less time than explaining why it is wrong, are you going to do it if they tell you so, just cause it takes less time? It is, in fact, a matter of principle here, I will have no problem with having "main" as the default branch, but the reasoning behind it, for many people, is wrong. Now I'm very scared of people who just do things cause it takes less time than understanding what the problem is.

We'll be letting our students decide.

 

I do.

Renaming master to main is a small thing and should not bother you, right? Absolutely!
I'm not bothered by this and I am happy to do whatever I can to make more people feel included or less excluded/repelled.
That being said, change (might it be ever so small), does not come easy for all people. We are stuck in our comfort zones where our habits rule. It's called comfort zone for a reason!
It also triggers people, if you say 'This is a racist term, stop using it.'. People will go in denial saying 'But I am no racist. Ergo this can't be a racist term!'
There are so many layers of psychology involved, I cannot uncover all (Dammit Jim, I'm a software engineer, not a Doctor)

There is one thing that bothers me: The power of github.
Github is a privately owned company with a massive impact. If github decides the new name for the default primary branch will be 'main' then this will be a fact. No discussion in the community, no suggestions, no voting, nothing near to democracy. What if their next decision is not that benevolent? They are the de facto monopolist.
This is why I do not like the process behind the decision, whereas I can agree to the decision itself.

 

Hi Christian,
thanks for your reply.

First of all: I'm totally aware that the change is not easy for everyone. But I mean it in a technical way. There are software projects out there that have tons of automation scripts, hooks, and whatever that contains the word "master" to reference the master-branch. It's not easy to change the name of the branch in these projects.
And I'm not so much on the "CHANGE IT NOW OR YOU'RE A RACIST" side of this discussion. But I think we can all make more people feel included when we start changing it whenever we can make the change with reasonable effort. So start with your small projects where you do not need to update any automation scripts. There are millions of repositories out there where the change will be easy. Why not do it?

Because it's not comfortable? To be realistic: What will happen?
People will type git checkout master from time to time and will see the error, that master does not exist. And everybody will immediately remember that it is main now. Relearning this will take 5 days, tops. I'm ok with investing a couple of failing "checkouts" to make this change.

It also triggers people, if you say 'This is a racist term, stop using it.'

I can totally see that. But to be clear here: I did not say that. Most of the devs who stand up for this change are saying: "This term makes some people feel excluded/not welcome. I think we should change it."
And yes, there are hardliners on both ends. But let's have a healthy debate.

And I'm not so much on the "CHANGE IT NOW OR YOU'RE A RACIST" side of this discussion.
You might not be, but consider what message people are receiving. Communication is very hard. See "Friedemann Schulz von Thun" for the problem of sending and receiving messages. I trust, that German is not an issue for you ;-)

Because it's not comfortable?
Exactly. Like I said, it's called comfort zone for a reason. Change always needs energy to overcome inertia. Be that in Physics or in Psychology. We humans are beings of habit and tend to reject suggestions to change. This holds true, especially if the change is forced upon us by some "higher force".

But let's have a healthy debate.
This is what I wished would have happened. Github took this opportunity away by deciding on a new standard without asking. For a company that claims to be community-driven, this was not a smart move.
The goal is noble and right, the methods are questionable and I fear, did not help the cause.

 
Sloan, the sloth mascot Comment marked as low quality/non-constructive by the community View code of conduct

The term "master" is a bad one, but claiming it's racist is an idiotic reason to change it. It's non-descriptive and counter-intuitive vs e.g. "default".

Has nothing to do with racism, "master" is not a racist term, and this is not a race issue.

Thing is, we do not get to decide what counts as racist, as we (the white dudes) are not affected by it. Your argument is invalid, sorry.

Sloan, the sloth mascot Comment marked as low quality/non-constructive by the community View code of conduct

No, sorry, yours is. You don't get to invalidate me because of my skin color or genitalia.

Try this one with a PoC and see how this works out...

Sloan, the sloth mascot Comment marked as low quality/non-constructive by the community View code of conduct

So you're saying they have special rights to disregard people because of their skin color?

No, nobody does.

Sloan, the sloth mascot Comment marked as low quality/non-constructive by the community View code of conduct

This is a waste of time. If you want to be racist, be...

Sloan, the sloth mascot Comment marked as low quality/non-constructive by the community View code of conduct

What an incredibly stupid statement and pretty ridiculous of you trying to make me into a racist because I don't think the term "master" in Git is racist.

Grow up.

I just have to say something here. Cause this whole thing is getting quite ridiculous. As a person of African origin(Nigerian - born Austria raised in Ireland) I've never seen master with regards to git as something that is related to slavery. Never. I've always understood it as the master branch. As in the main branch. The way I see it, this change is more of a nice-to-have cause it makes more sense now.
Even with the master-slave strategy which I used when working on Robocode virtual AI robots, I understood the context. This robot controls the other robots and those robots follow the command of that robot, so its called Master-slave. This has nothing to do with human slavery. Robots/Machines/Software/Code don't have emotions. If I wanted to, I could call my computer my slave and there'd be nothing ethically/morally wrong with that. Why? Because it's a machine that has no emotions and it was specifically built to obey the commands I give to it. It's a machine not a human and I understand that difference.
Personally I feel that these small remarks by companies saying "this is making people of colour feel more inclusive in the industry" or that "this shows that we support people of color", actually downplays the real problems that people of color actually face in industry.
Either way I'm happy about the change (although my OCD will now cause me to change all my Github repos from master to main. So a big thanks to

afrodevgirl image
for helping out with that). 'Main' makes more sense but this shouldn't be used as a "See, we support people of color now. So we cool?" card.
This is just my opinion as a black person. I understand that there are other black people that feel differently about this and I respect their views just as I hope they respect mine.
 

"I cannot understand why so many people are resisting this change."

Because it is a breaking change for no real reason - and as an engineer it makes my eyes roll.
It is also a "panic reaction" and a "displacement activity" instead of facing the real problem - and as and intelligent person who dislikes BS, especially instead of real solutions and actual debates on how to reach them, it makes me cringe.
And it's also done in an idiotic way - which again, makes me as an engineer and an intelligent person sigh in annoyance.

Let's start with the very first thing: Git's (and thus: Github's) "master" has nothing to do with slavery. There are no "slaves" in Git. The "master" refers to the "master recording".

I know that there is this one email where SOMEONE ARGUES that the naming PROBABLY comes from BitKeeper where it was used as part of the master/slave terminology. And I see you have also used it in this thread as if it were some kind of evidence.
Nope, it's not. It's someone's theory, and I find it alarming how people driven by their agenda try to push an OPINION AND THEORY as an evidence.
Especially when it's totally false: twitter.com/xpasky/status/12722807...

This makes it the whole premise false - thus my claim that this change is for "no real reason".


On the other hand, tt's a breaking change, which means extra cost (for no reason) for developers using GitHub, for developers who will start using GitHub in the future and also for GitHub's own tech department.

1.) It breaks the common standard shared by Git, GitHub and GitLab. This hurts portability and adds annoyance. Now it will e.g. be possible that I will get different result if I first create a local git repo and then upload to GitHub compared to if I did it the other way around.

2.) It breaks tooling.
Do you have a release script that makes sure that you are on the latest version of the master branch before allowing the release? You have a problem then.
Do you have a pre-commit hook that guards against committing directly to the master? You have a problem then.
Do you have any kind of innovative / crazy / highly customized / whatever tooling that references the master branch in anyway? You know, all the kind of unforeseeable stuff that is sure to happen a lot when over 40million developers are using your stuff for all kinds of projects.
Yepp, you will have a problem.
Now, of course GitHub will try to mitigate these problems with the addition of new tooling and automation - which will probably add new layers of indirection for the users and new functionalities to maintain (and thus quite possibly new bugs) to the GitHub team.
And normally, such a change would be rolled out in steps to test waters and stuff. You know stuff like beta testing as such. But now, instead it is rolled out in one huge update which will affect all the over 40M developers. Heck of a way to test new - and seemingly put together in a rush - features.

3.) It breaks documentations and TUTORIALS. And most of these will not be updated. Now we will have broken tutorials all over the net. So new users will be easily confused.
Add the possibly user indirection that the new GitHub automation will possibly introduce and you have just effectively increased the entry bar for using GitHub for new devs.


And now let's continue about how this is a "displacement activity" instead of trying to make a real solution.

I have no problem replacing the master-slave terminology. But the intelligent and engineering way is to do this by acknowledging the cost of doing this and trying to minimize it.
From a purely technical point of view, the master-slave terminology is a very good terminology. It clearly express the relation of the master and slaves. The words themselves are not that much used outside the terminology (the "master" is a bit more, but the "slave" is basically only used in this context which makes reasoning about and searching the code much easier). They are widely used in the industry, so everyone knows what they mean.

So if we are to replace this terminology, then as an engineer, my requirements is to have a similarly good new terminology for as low a cost as possible.

This means that first of all, there should be a wide-spread discussion about what should be the new terminology. Let's create a new widely used replacement instead of everybody choosing their new one.

Secondly, I want the new terminology to be expressive. Also want the new words to be not overused by other meanings.
Renaming the master to main does not satisfy these requirements.
The "main" is already used for a lot of stuff. And whatever you rename the "slave", it won't express the same relation. So it's simply a quite bad name.

Thirdly, I want the cost of change to be minimized. So that the amount of code, documentation, tutorial, whatever that needs to be updated is minimized.
The obvious way to achieve this is to leave the name "master" and rename "slave".
E.g. rename "slave" to "minion" as it is done in SaltStack.

It clearly express the intent, the name "minion" is highly unlikely to to be used in some other way in the code and it minimizes the cost by keeping the name "master".


Oh look, if we don't do BS as a panic reaction we could actually do some meaningful stuff!

And that's why this is infuriating.
GitHub could have just say, that:
"our 'master' branch refers to the 'master recording' and we do not use master/slave terminology anywhere so it does not affect us, but we still feel that inclusive language is a positive goal and we should push for that. But since the term is a wide-spread industry standard, it should also be replaced by a wide-spread new standard instead of everyone just trying to figure out their own replacement in a rush.
So we are calling upon the big companies and open source community to let's find a new terminology that will be adapted.
The new terminology should clearly express the intention behind the architecture (i.e. one boss delegates the jobs to others while supervising them); It should be not over-used for other uses; And ideally, the change should be as natural and pain free as possible.
For this reason, our team has checked the alternatives that are already in use and found the following ones to be a good candidate:

  • master / minions:
  • ... "

Look at the difference. This reaction would have made sense. This reaction would have actually tackled the actual problem. On a industry level, nonetheless.
This reaction would have actually also taken into consideration the millions of engineers who uses GitHub.

Many of them not even being from the US so they don't even have these kind of "triggers" that you have in the US. What happens here is basically a US-centered panic reaction being forced down the throat of the whole world.
I don't know if there is already a "US progressive" world for this, but shouldn't we call this something like "cultural dictatorship"?

Just food for thoughts...

 

This really hits the nail on the head.

I'm a black software engineer and I don't find the use of the word "master" offensive, in any way whatsoever, and neither do any of my black developer friends.
In my opinion, it's an unnecessary change that doesn't make blacks in the tech industry any better. I heavily doubt that there was once a black dev that quit programming just because he/she ran into GitHub's "master" term.
I also doubt if there can even be any measurable impact aside from the PR and social points GitHub is getting by implementing this change.

I totally agree. Like honestly, I saw this post the other day and
started questioning whether I'm black because I didn't see it this way.

 

I cannot understand why so many people are resisting this change.

I honestly can't either. It's such a small thing. Even doing it by hand takes a minimal amount of time!

We've been having this discussion at work; in the course of the discussion the topic of the etymology of the term 'master' as used in tech came up, and discussion of whether or not it was meant to be taken in that sense. Someone replied to that all asking "Does intent matter here?", and I think the answer is "no".

The analogy I used in the discussion there is that if hurl something at someone's face, they get bruised. And with regards to that bruise, it doesn't actually matter if I threw it deliberately or if I lost my grip on something while gesturing and flung it accidentally; they get hurt either way. And I'd think we all want to avoid injuring our colleagues, even if such injuries are accidental.

I mean, people put on wrist straps when using Wiimotes or JoyCons or VR controllers of any form because you don't want to fling them at someone's face unintentionally. I view renaming the primary branch of a repository to be akin to those wrist-straps: a safety measure to ensure we don't unintentionally fling daily microaggressions at someone's metaphorical face.

I mean, the only reason I haven't migrated all of my own older personal repositories yet is that I'm trying to work on a tool in my spare time which will use the github GraphQL API to handle the whole process—including shifting the default branch to 'main' and migrating any necessary branch protections from 'master' to 'main'—and have left the repos I'm not using on a daily basis as a final test case for when I finish.

 

First things first: I saw you joined dev.to just a few days ago. I am glad you joined this great community. Welcome!

Thanks for your reply. I agree 100% with your comment. It's good to see people like you with a healthy attitude to this subject.

Most people don't understand that it is not about them. It's not about them "being racist". You are not a racist if you use "master" as your main branch. That's not the point. It's about the other people interacting with your repository and your code. The point is: how do THEY feel?

 
 

Hi Alexis! Thank you for writing this. I've been meaning to do this but I thought it would take longer. Your post showed me the way and gave me the little push that I needed.

I have now followed your steps and changed the default branch to main in my personal website's repo.

I had to remember to change the "production branch" in my deploy settings on Netlify to avoid breaking automatic deploys.

 

Good note, I'll need to do that too for one of my repos. I'm glad I could help make the process easy!

 

Love how you have added your personal perspective here! Thank you so much for sharing!! I started changing mine as well. I started with my blog by renaming master in all posts, routes, and the git branch itself.

I find the level of backlash this change has seen in the industry rediculous. It is so easy to do, and if it brings just a bit more welcoming/inclusive feel to my projects I am down for that all day!

 

I find the level of backlash this change has seen in the industry rediculous. It is so easy to do, and if it brings just a bit more welcoming/inclusive feel to my projects I am down for that all day!

Amen. That's exactly my thought.

 

Thank you Alexis. It's always crucial to listen to the lived experiences of Black people when it comes to these issues. Knowing it was/is an issue for you makes me really happy to see all those white dudes lose it because master got renamed 😂

Please keep sharing your experiences, we need more of them ❤️

 

Thanks for sharing your perspective on this, Alexis!

"That's literally it." --> 💯

 

Thanks for posting this. You may have noticed that the move to rename 'master' in Git has been causing something of a heated debate; so you deserve massive respect for doing this given the current backlash from some quarters.

If I'm honest I can't say that I'm not confused by the issue the word causes when used in isolation; but I'm white/male/privileged and European; so it really isn't my call...

 

There are multiple angles to this issue - and most of them are not "wrong".

As others have already pointed out, it's incredibly silly to become entrenched over something as trivial (and as simple) as a name. If someone wants us to change the master branch to the main branch... fine. Whatever. I may slip up a few times and call it "master" again - but I'll get used to it. That's easy.

If my friend Joe tells me that his name is now Josina, and his pronouns are she/her... fine. Whatever. I may slip up a few times and call him "Joe" or "he", but I'll apologize and correct myself - and I'll get used to it. That's easy.

But in contrast to the infinite pile of things that I'm not qualified to speak about, I'm incredibly well-versed in the behavior of white folk. Especially: white, Anglo-Saxon, protestant, straight, male, American folk. And if there's anything that we have in common, it's the desire to make ourselves feel good over (barely) doing something - that was easy - while actively ignoring everything that's not easy. All while pulling a muscle as we pat ourselves on the back over our newfound "wokeness".

I understand that there are, unfortunately, many people out there resisting these kinds of changes (these easy changes). And quite frankly, I think that most of those people are somewhere on the spectrum between stubbornly recalcitrant and outright racist.

But this isn't just a theoretical debate. People in general - even well-meaning people - typically have only so much "mindshare" for an issue (that doesn't effect them directly) before they tire and move on. If black folk have suffered a thousand injustices in the US (and they have suffered a thousand injustices in the US), and at this particular juncture circumstances have conspired to actually make (some of) those white folk listen, which items do we want to address in that list of a thousand injustices??

Because the sad reality of race relations (in the US, at least) indicates that there's absolutely no chance that all-or-most of them are gonna get addressed any time soon. And once you change that master branch to main (or whatever), I can guarantee that a bunch of "my tribe" are gonna feel like they've accomplished something. Like that's it. Like they've done the work. And now it's time to rip off that COVID mask, head out to the tailgate, wrap themselves in the flag, and holler fer Murrica.

I would NEVER claim that, because "this black person over here doesn't have a problem with it", that this is somehow not a "problem". But I do think it's instructive to highlight some quotes that I've gotten from my own circle of (black) friends on this:

One of my black friends, whom I respect deeply:

We ask for equal and fair treatment and instead we get pandering. We asked for an end to police harassment and we get a different name and face for bottles of syrup. These measures are to make people feeling guilty sleep better at night, not to benefit us in any way. Some of it is silly.

And from another whom I equally respect:

It’s white guilt gone awry. None of us care about syrup or other product placement. We just want the cops to cut the bullshit out and the courts supporting them.

Again, just because those black people don't care about such a change in no way indicates that Alexis's concerns are unfounded - or that we shouldn't make the change. But making this change is, quite literally, the least we could do.

Finally, although I support changing the branch name, it implies a broader question about the general use of the word "master". "Master" is used in hundreds of different contexts - most of them having nothing to do, in any way, with race.

"Master" isn't some obvious slur. In fact, "master" is almost never used in any way that implies racism. If I use the word "master" - in any context - from here forward, are people gonna start murmuring under their breath that I'm a racist?? Are we somehow implying that we've now cancelled any possible use of the word "master"?? Cuz that's a tall order.

This isn't like defending the name of Washington DC's NFL team - a term which has no socially-acceptable use and was coined solely for racist purposes. This is targeting a fairly generic word that, in nearly all cases, has nothing to do with race. I think this is where a lot of the resistance comes from.

You achieve an Associate, then a Bachelor, then a Master. The MC is the Master of Ceremonies. A very senior enlisted person is a Master Chief. When someone demonstrates incredible skill, they've delivered a master class in the subject. A device that converts force into hydraulic pressure is a master cylinder. An eastern spiritualist is a Zen master. The print from which all others are copied is the master print. The list goes on...

But if I have the gall to actually speak any of these terms going forward, am I racist???

 

I 100% agree with the people you quoted. This kind of naming change will do very little to quell the overwhelming racism in the US. I am also a single person within a community that has its own issues in regards to race and gender. So I am advocating for change in a space I have the ability to make that change.

In regards to the word master in all of it's various contexts...I view the tech industry's usage of it to be problematic simply because of the master/slave terminology. The term master in the tech industry does nothing to describe the technology it's used for. I mean really think about the words master and slave versus something like primary and replica. Master/slave tells me that the master database owns another slave database and forces it to work for them. That isn't what that relationship is so why are we using it? To be quite honest, if master branches existed and there was no usage of master/slave in the industry I would have less of a problem with it. But overall, its incongruous to assume all usages of the word master are inherently racist.

 

So I am advocating for change in a space I have the ability to make that change.

Excellent point. Advocate for any (and every) change that you can - big or small.

Master/slave tells me that the master database owns another slave database and forces it to work for them. That isn't what that relationship is so why are we using it?

I appreciate the clarification. And yeah, that makes total sense.

Best regards to you!

 

I found this tweet by the person who chose those names in the first place to be interesting.

 

I'm from Poland (Europe), we didn't have slavery here and not much black people live here nowadays. But I have nothing against change from "master" to "main". If the old name was offensive or disturbing for some people, let it go. Besides "master" wasn't very good name anyway. I believe "main" is much better name for a main branch - cause that what master branch really is - just main.

 

I'm a "person of color" and i honestly never felt bad about the terminology, if you feel bad about a term then do the change in your own projects but do not enforcing this kind of things into others just because we use a term does not mean we are pro racism or white supremacy.

Also you have to remember that the developer community extends outside the US and there a lot of other people in other countries that do not feel that way, i understand the police brutally black people suffer in the US is horrible and a change has to be made but that change will not come from changing a term that it has nothing to do with and it has a complete different semantic

 

While all people of color face oppression, the term "master" in relation to the black experience in America is an isolated case. I don't expect other people of color to have the same visceral reaction I do. I've never, and would never, accused anyone for being racist for using the term in the context of Git.

I'm not an all powerful developer that can force people to change their use of antiquated terminology. But what I can, and will, do is help people that want to make the change do just that. Especially because the term "master" doesn't accurately describe what that branch is doing.

 

That's ok if you do not feel comfortable with the term then you are free to use your naming conventions you prefer i do not have any problem with that.

How ever this entire discussion about the "master", "blacklist/whitelist" is more like "progressive" propaganda and there is some groups of people that just because you don't buy their agenda they immediately label you as the oppressor and the root of all evil and that is simply stupid because you will not fix the original problem (which btw still does not have anything to do with the industry conventions) you end up dehumanizing everyone that does not agree with your point and in some cases it even radicalized them to the other extreme, i beleive is time to stop the PC nonsense and be more tolerant to each other

While I think some of the characteristics of the current BLM movement are over the line and not really beneficial to the cause, I find also quite superficial to dismiss them as "progressive propaganda", "nonsense" and "stupid". Isn't that dehumanizing?

It's easy to think that everything that doesn't directly resonate with our life is meaningless, but with time I tried to assume that it's more a fault of my limited perspective. I.e., I think people do feel bad for reading some terms if they just say so and if I have no evidence of the opposite. It's called trust in other people's honesty, and it's something I'd like to be applied to me too if there will be the chance.

And I may be out of American politics, but it's interesting how "progressive" is seen as a bad thing. Shouldn't we all like progress? 🤔

I think it's not only a question of whether people feel a certain way about reading a word, but also about how valid that emotional response is to society. If someone has personal experiences that make them particularly dislike a certain word, telling them "no you don't" is just plain ignorant, but that doesn't mean there can't or shouldn't be a compromise.

I'm not fundamentally against changing a word just because a small minority finds it offensive, but everyone can find anything offensive and it is ultimately up to the society whether it's a reasonable response or over the top.

The only metric I can apply to judge this is how I'd feel about something like this, and I'm just not the type of person to care about words either way, so neither can I relate, nor do I personally think there's any real problem to begin with.

 

We are the same. I had such a hard time understanding this specific issue. I'm neither white nor black. Coming from a 3rd world country we had different kinds of issues there. Coming to America, this issue wasn't something I really didn't pay attention.

So it was very hard for me to empathize on weight of words. Nor defunding police is something I've seen first hand the consequences of underpaid police.

I was called a racist for not empathizing to the cause. oh well. 🤷‍♂️🤷‍♀️🤷‍♀️🤷‍♂️

The issue with America, is putting too much labels on things. I envision a world, where you get labelled by your name and not skin color or heritage. if thats too hard. maybe ID #s

 

I'm from Germany and I've always found it weird how much emphasis North-Americans put on words. You can also see it a lot with "swearwords"; where in Germany we don't mind saying a word in a sentence like "You shouldn't use X" or "The word X has many negative connotations", in America there seems to be no separation between that and actually using the word itself.

But I also think that, in general, Europe has a much stronger cultural tendency to value intention over vocabulary.

 

Does this have any impact on branches that may be currently taken from master? In other words, say I have a branch issue-14 where I'm actively developing, and when I'm done, it will be merged back into the default branch. Would I need to wait until I'm done with that branch before change the default branch's name?

(I'm not a git guru; I use it a good bit, but this isn't an issue I've tackled before)

 

I had an active branch (not pushed to github) while I changed the default branch and experienced no issues when I submitted the pull request after I completed the conversion to main.

That said, once my local environment was converted to main, I rebased my active branch with main before pushing it up. But even if I had a PR up before the conversion I should have been able to change the branch target in the github ui.

Let me know if you run into any issues and I'd be happy to help debug the issues!

 

I think I got it. git rebase --onto main just rewound the HEAD revision, but then GitHub Desktop told me I had commits to push and pull; once I did that, everything looks peachy. (Maybe leaving out --onto would have made it one step...)

Now, once GitHub changes GitHub Pages to work from the default branch (which I imagine has to be something they'll do soon, since they're all in on this), I can completely remove it.

 

Branches are really just labels git puts on objects and updates every time you commit on them. When you branch off, you're branching from a commit, not from another branch. When merging two branches, git doesn't care about their names either, just about the latest commit they have in common, which doesn't change with a rename.

 

Thank you for this article, it was very helpful. I'd just complement that, if one wants to type only git pull, it may be necessary to set the upstream of the branch:

$ git branch --set-upstream-to=origin/main main
 

I just got a notification from a company I follow called puppet and they wrote a short article about how they're doing the work to remove harmful terminology from their products because language matters. I hope that the people on this thread who have pushed back will stop and listen to you, really listen and understand that you are sharing your experience and how you have been made to feel. I hope it's okay if I share the article here. It's just that when I got it, I instantly thought of your post.
puppet.com/blog/removing-harmful-t...

 

Here's my perspective, in case anybody cares: Most of the world outside the USA will be either confused by this change, or annoyed, depending on whether they're even following the current social situation over there.

First of all, "master" comes from Latin and has cognates in many languages across the world, most of them maintain a meaning closer to their original, like the German "Meister", which can also have the master/slave connotation, but outside of very specific contexts is usually associated with a mentor/teacher or someone who's "mastered" something. Many foreigners will bring these associations into the English language as they learn it.

Second, while most of the world has some dark past with slavery, most of us have gotten over it. The USA has some very specific set of circumstances that keep this topic relevant, but that does not affect most of the rest of the world, where slavery didn't always go hand-in-hand with racism, but instead was much more closely linked to classism or just plain military conquest.

Considering those main factors, and the fact that such a change, going directly against the convention of git, I can't help but feel (and I know many non-USA people feel the same way), that this is, yet again, just the USA pushing its agenda on the rest of the world as if they $#@€ing own the place. Never mind people who aren't all that good at English and just want to add their part to the OS world constantly being confronted with weird vocabulary landmines they neither understand nor learned in English class in school.

Personally, I prefer main. It's shorter, makes more sense and is nicer to type, so if it had been chosen as the default, that would have been better than what we currently have; but with master having been picked as a default, I do think that moving away from that convention will just cause problems, specially since there's no way the whole OS community is going to make that change.

 

I disagree with the change.

As a non-US citizen, I feel I am being forced to change my habits based on something that no-where in the world relates to me. I don't know how the community has consented this change based on the history/society of a particular country/community.

I am not denying the contributions of US in the tech world. Its massive.

What about Indians who contributed a lot to the software world? What about the Chinese who have been constantly pushing the boundaries of the electronics world? These two countries alone constitute half the world population.

I don't have a problem with whether you want to change master to main. I will do it.

But I think in the last 4 years this is the first time I am seeing a change being done based on the happenings of a particular group/community/country etc. And this is not good. Centralization/Influence of such a single entity unrelated to software in the open-source world is not a good sign to come for us people outside the US in future.

So, yeah. My reason for disagreeing with the change is the above! And nothing else. No society, individual, community, country should ever affect the way open-source software works. It should be a collective effort!

 

Hi Alexis,

Thanks for your extremely straightforward guide! Might I suggest a step 3 if it's not allready been mentioned -

Use git remote -vvv & git remote -p upstream (or other remote names), particularly if it's a forked project (& the upstream fork maintainer has made a similar change)

 

I always thought the term "master" as it relates to version control systems was similar to audio mastering where you produce the "final mix" or "gold master" as the source from which all subsequent copies would be made...hence the "master branch" in version control.

But to me, "trunk" makes more sense than "main". After all, how could you have branches without a trunk?

In any case, I'm in no way trying to diminish the importance of changing the "norms" to be more inclusive.

 

Hi Alexis,

I fully support this change and am wondering when GitHub will follow suit (they did say they are on the case).

It saddens me that the term has caused you pain over the years. This got me thinking, though -- the word is used in many other ways in various contexts. So I'm curious, how do you feel about the word "master" in other situations?

I am deeply involved in various spiritual practices, and for me the word "master" is associated with attainment of high levels of spiritual awareness. So for example, "Zen master" and "the great masters" (e.g. Buddha, Christ, etc.). I perhaps also make this association because of my education in Latin and Greek: the word "master" comes from Latin "magister", meaning "teacher".

How do you feel about such uses?

 

Hi,

I see a problem with this not because people don't like it, or they will need to get used to it, or something similar.
I see a problem from devops/administration perspective. There are millions maybe billions of scripts/tools/automation written around these terms.

  • they rely on master/slave in database/cluster context
  • they rely on master being the default git branch
  • they rely on blacklist/whitelist for some software

The change itself in software/repo is small, simple even, however what about tooling around that doesn't know about this change. What if every repo will implement these keywords differently (I've seen already roughly 5 alternatives for blacklist/whitelist)

Now imagine situation. You have a software and automation around that software. This software is responsible for breathing systems in a hospital. The server where it runs breaks, luckily it is clustered, but hey, the automation counts with master/slave, but now suddenly the automation broke, because someone updated the clustering software which already implemented the keywords changes.

There is a software that used --blacklist and --whitelist as a params, but now these changed to --allowlist and --blocklist and suddenly automation that counted with original keywords breaks.

And this is not even a big stretch of a situation, system updates might be automatic, or they might be done by separate team, so team responsible for automation might not know it.

This can have mild consequences, but it also might have a catastrophic ones.

If we can ensure that these changes can be really done smoothly without breaking important stuff, then yeah, feel free to do it, but can we really?

Honestly I think this is more a problem of whitelist/blacklist and master/slave. Changing the branch name might not be as risky, but if we are not careful with these changes, and will start randomly changing words used for decades, it really can cause some serious troubles, even lives.

 

Our jobs very often literally revolve around problem-solving to automate our own jobs into oblivion.

I'm sure we can manage updating our scripts or making aliases to transition. It's not like deprecation doesn't already happen all the time.

By the way, MongoDB moved away from "master/slave" ages ago. As has AWS, Microsoft (SQL Server), and several others. If you use any of the tools that have switched and haven't noticed, then it's probably not as impactful as you seem to think.

 

This is total bullshit and useless. You can have any name you want on your branches, and you were able to do this since forever. But hey, let's do something useless and be proud about it, because creating things that actually matters takes time and effort. Renaming this will not change history. Also, we have nothing to do with the slavery which happened in the past. It's a fake discussion which forces everyone to take part of it with these useless changes just to help someone win elections. It seems that when humanity has no real issues. they are creating their own fake issues and start investing energy in it. #antislaverybullshit

 

Thanks for sharing this. I have no problem renaming these if it makes people happy. I really doubt these were named with racism in mind. However we keep history as a constant reminder and for future generations not to repeat stupid things that happened in the past.

A few words from some great men.
m.facebook.com/story.php?story_fbi...

and on the humor side .... somewhere someplace there is a child that wants forking processes to be called something else.

 

Honestly I was just wandering why they changed it. And when I saw the reason, I wasn't mad, I just think it's a dumb reason. I cant believe people would feel uncomfortable with that.

At least with blacklist and whitelist I can see where you're coming from even if I still don't think it is reasonable to feel uncomfortable because of that.

I think that getting feeling uncomfortable for the term "master" doesn't make sense. It would be like me getting offended every time someone says the word.

It would be like me, a latino, getting offended by the word speak because it was used to make fun of latinos and used as a slur "spic".

 

My 50c ...
it is stupid to make such a rename ... why? ... because renaming from master to main is in its core very racist thing to do :)

If you perceive a word master in programming as a thing which can cause racism - or - you feel that it is somehow attacking on you - then to tell you the truth - you are in your core a racist person.

Another 50c
blacks aren't the only race that was dominated by other. During our history, there was a big chunk of very bad things happening. Wanna example? See Slovakian people .. we were dominated by todays Hungary over 1000 thousand years. Yet I don't see any of my friend telling me ... see that master branch? let's rename it to the main cos I feel hurt ....

 

Thanks! This was as simple as you said. This might be helpful to others using two-factor authentication. I needed to setup a personal access token, as detailed here: medium.com/@ginnyfahs/github-error...

 

Why don't we name it prod instead of main?

 

You certainly could! Although that might depend on your workflow. For example, in the Git Flow philosophy the 'master' branch is not the one you merge into after your code has been reviewed, its typically called 'develop'. But prod is definitely more descriptive of the contents of that branch so I'm all for it!

 

In my opinion, naming the default branch "prod" (or some variation) is actually a fantastic idea almost regardless of workflow. Here's why:

  1. In every workflow, there's a branch, somewhere, that pushes to production. Whether that's the default or not and what exactly it's named isn't particularly relevant in the context of git (branches can always be changed). It's still the one that gets pushed to the production server or pulled by the pipeline to build the production result in some fashion. This makes it explicitly clear that this branch is the production one.

  2. Naming the default branch "prod" sets up that expectation and discourages directly changing the code on that branch from the get-go (something I know I'm guilty of). In other words, it forces us to be mindful of what we're doing, even early in the project, where habits are most likely to be formed and ingrained, but workflows and processes are most likely to be super loose. We start with the habits we want in the long run, instead of allowing bad habits and then having to unlearn them later.

  3. In workflows where the default branch isn't supposed to be "prod," it forces that split immediately (again, avoiding the fast-and-loose tendency that can happen early in a project), by forcing a new branch to be created to become the new default branch.

The beauty, too, is that most of this can be automated with aliases if you want the automation. Then you get the git scaffolding your project needs from the beginning, and you've still gone through the process of making thoughtful decisions about it (or, you made the deliberate effort to not be thoughtful and mindful about how you set up your git repository).

I could not agree with you more!

 

We've always thought about this with MIDI instruments. We have a sequencer that is telling the other things what to do - and the manuals refer to that as 'slaving' or the master and the slaves. Thought that was weird since I was little. It seems like the sequencer is like a queen and the modules are the drones, or the sequencer is the conductor and the modules are the players. Why wouldn't the main branch be the "root" ? or the "Trunk" since the branches branch off of it? or "core"?

 

"We can and should be better than this."

Thank you for posting this Alexis — in my opinion, you're absolutely right!

 

the context is so important nowadays (eg look for DDD). We are into the context of developing, so master o only referring to our trunk develop. No more no less. Mixing context means complication in dev. Please follow this good practice. Be a clean coder

 

Thanks, this makes it awesomely simple... except for those of us who only use GitHub every now and then.

Any chance you could also include the complete set of commands (git clone, etc.) to make the change in each of our historic repositories - so then we have no excuse?

 

Done! Thanks for the practical instructions.