DEV Community

Discussion on: Replacing master in git

Collapse
 
icatalina profile image
Ignacio Catalina • Edited

As far as I know, the issue is not with the word master but with the word slave. I'm not sure why you see git's master as the kind of master/slave relationship.

To me, git's master is more of a master/copy:

master

Collapse
 
stevieoberg profile image
Stevie Oberg

The problem here is those originals are not meant to be changed; a new version can be made but it never really replaces the master. And there should only ever be 1 master copy. thus implies this branch should never be touched. But that is rarely the use case for the primary branch.

I like main for the primary branch's name; it doesn't imply anything more than "this is the primary source to use".

Collapse
 
icatalina profile image
Ignacio Catalina • Edited

You can create new masters out of old masters. Which is exactly what git does. Same for other types. You grab all the masters from recording a movie and produce a master for the actual movie. You edit it for the dvd version and you get the master for the dvd version...

The fact that it gets updated doesn't make it let of a master. Deployments get copied from there and can't (shouldn't) modify the code. And it is at any given time the source of truth for your project.

Having said that, I don't really mind how we call it. I'm not against changing the name. It is just a convention. If it was for me, we can call it potato 😅

Thread Thread
 
stevieoberg profile image
Stevie Oberg

I'm aware that you can do that; my point is that the terminology doesn't imply that for a lot of people, myself included.

When I think of a "master" copy, I think of the original manuscripts for something like the Iliad. We're not meant to change that copy because it serves as the source of truth for the Iliad story. Once you change it you have a new copy with a new "master" version that doesn't replace the old (unless it's a verbatim copy). In git though, that new version becomes the master copy.

But I'm glad you are open to change though, I actually don't see the full association with master/slave either tbh. I just don't think the name made much sense to begin with, thus if it also makes some people uncomfortable then there isn't much of a reason to keep it. 🤷🏻‍♀️

Thread Thread
 
icatalina profile image
Ignacio Catalina • Edited

I think the misconception comes from interpreting master as a single entity. The difference with the master for a book is that copies are meant to be the same book. If your book is a modified copy of the Iliad, it is a master for its own version of the Iliad. What your describe in git is not copying, is creating new Iliads. We add more stuff and create a new master for others to make copies of. Which is the most recent master.

The reason to keep master is cost mainly. Cost of changing all the tools, hours lost trying to figure out why some script doesn't work or why some tutorial doesn't make sense. EVERYTHING has a cost. Even keeping it has a cost, a different kind though. Is it worth it? I don't really know. This article is the first time I've encountered this concern, without digging a bit more I don't know if it is a shared concerned or just someone creating a problem from nothing... 🤷‍♂️

To reiterate, I'm not against the change. I just think it is good to understand NOTHING is free.

Collapse
 
damcosset profile image
Damien Cosset • Edited

Git's master is historically tied to master/slave. It got the name from BitKeeper.

Source here

Collapse
 
yawaramin profile image
Yawar Amin

Not quite. That was an interpretation, based on quite a lot of inference ('probably'). On the other hand, the guy who actually came up with the term says he meant it as in 'master copy': twitter.com/xpasky/status/12722807...

Thread Thread
 
waynejwerner profile image
Wayne Werner

FWIW he also suggests that the BitKeeper history might also be valid.

Given the fact that I don't remember why I called a thing that thing 6 months later, wouldn't surprise me if that were the case. It's also possible that both were the case: master, the word, came from BitKeeper, and he also learned that it meant something else.

Thread Thread
 
yawaramin profile image
Yawar Amin

Yes, you are right. I later learned that the git team were thinking and using 'master/slave' terminology for repos around that time.

Collapse
 
jrtibbetts profile image
Jason R Tibbetts

But who knew that that was the origin? I remember the days of The appallingly-named master & slave device controllers, but had no idea that the same terminology was originally in git.

Collapse
 
icatalina profile image
Ignacio Catalina

Fair enough. If you look at bitkeeper's documentation though, it refers to master as the master repository. In git, all repos are equally important, it is hard to see when we normally use a server (eg. github) as the source of truth. But in reality all repos are their own master. If anything git freed all the slaves, hehe.

Thread Thread
 
damcosset profile image
Damien Cosset

I hear your point. But the master/slave denomination is still quite common is technology. Even if it is rarer these days. The history is there and even if the meaning has changed or time has passed or whatever, if there is a slight chance that this will be interpreted as master/slave ( like it is today ), it should go away.

Thread Thread
 
dandv profile image
Dan Dascalescu • Edited

UPDATE my comment grew into a proper post, 8 problems with replacing "master" in Git.

The comment below is only kept for historical purposes. PS: congrats to the OP for taking more time to think about this issue and keeping their post for accountability.


Why exactly should it go away? Because one sensitive soul out there doesn't have a bit of self-control and chooses an interpretation you have no control over?

Did you mean to oppress anyone when you simply used a word that had become standard?

Words have multiple meanings. "Drug" can get you in jail, or save your life. Should you never use "drug" again because a cop might interpret "I need a drug for pain" as you seeking fentanyl, not aspirin?

There's always going to be someone offended or triggered by anything. Choosing an interpretation of a word with multiple meanings is just that, a choice.

To me, "master" comes from the records industry, where you had a master record/CD and made copies. I don't see why I should mess up all my git workflow and scripts for the purely theoretical slavery interpretation of the word by nobody who will ever use my private repo, and why all git tutorials and articles should become invalid because "master" is now demonized.

Has anyone ever actually complained about this word for git branches?

Thread Thread
 
damcosset profile image
Damien Cosset

Yes

Thread Thread
 
jmccabe profile image
Info Comment hidden by post author - thread only visible in this permalink
John McCabe

Who? Other than you.

Some comments have been hidden by the post's author - find out more