Git's use of "master" is inherited from BitKeeper, which was definitely using it in the purpose of master/slave. Source: Re: Replacing "master" reference in git branch names (was Re: Proposal:
And if you don't trust that digging, here's the person who chose those defaults saying he wished he had chosen upstream/main
rather than origin/master
.
Here's two more mailing list responses from core git developers on the terminology:
The TL;DR is that while it may obviously be "master copy" and nonoffensive to you (especially if you're a white male, just in general (and so am I)), it's definitely not obvious to other people, and main
is at least as good an option as master
if you ignore legacy reasoning.
And nobody is suggesting to change a repository while there's still tooling with hardcoded master
. They're suggesting fixing the hardcoded references to master
, and then renaming existing branches. I believe GitHub is probably working on a feature to transparently redirect requests for renamed branches (such as master) to their new names, so that deep links into the master branch don't break, even. (Though you shouldn't be linking files on a branch anyway, you should be using the permalink which is via a commit hash instead, because that file could be edited, moved, or deleted, even if the branch name isn't changed.)
Plus, "master copy" isn't even a good analogy for git, which is a distributed version control system. The default branch is no more special than any other branch. There is no "master copy" according to git. All branches are equal.
Honestly, for rust-lang/rust, it'd be "more correct" to call the default branch nightly
or development
, because that's closer to what it is. If there is a "master copy" of the code, it'd be the published/tagged versions, not the development branch which is published as the nightlies and branched from to create release versions.
The only argument for sticking to master
as the default branch is that it's always been that way, and that's the default name git gives to a branch if you git init
and don't checkout a new branch, and that it's the default branch name used by GitHub. And GitHub is also moving away from (suggesting) using master
as the default branch name.
Frankly: there are multiple substantiated arguments for changing the default default branch name from master
to main
, and for reconsidering the use of master
as the default branch in projects that only use master
because it is the default default.
I have yet to see a substantiated argument that master
is a better default default branch name than main
, other than "it's the current one".
You don't have to agree that master
is a "bad" default to agree that main
is a better default.