You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had a look but can't see this already discussed - apologies if it has.
With Microsoft/GitHub recently discussing the removal of terms such as "master/slave"/"whitelist/blacklist" from their systems, including Github, could or should the term be review and/or removed from the Git Book and replaced with a term such as "main"?
I appreciate this would be a large task so might have to be done in stages.
(I've also raised this for discussion on the git-scm issue list git/git-scm.com#1487)
Reacted by HonkingGoose, Alex Chesser and James Midkiff
I'm absolutely on board with this kind of effort, and I'd love to take steps towards removing this terminology. There are parts of this which are under our control, and parts that are not. Until Git changes the default branch name (or lets you customize it for git init), the word "master" will need to continue to appear in the text.
Here are the things we can do in the meantime:
Add a note that describes how to set the default branch name
...using a template repo for git init
...using git branch -m for existing repos
Explicitly change the branch name when doing git init in examples
Assume the remote branch name is not "master" for examples with cloned repos
We do need to be careful to protect the newbie experience though. I don't want someone to get frustrated because they ran git init and the example text assumes that the fresh default branch is called main with no explanation.
Yeah, running git init from your local terminal will still give a master main branch.
Making a new repo from within GitHub also still gives a master branch as of today.
I don't know when GitHub themselves will use the main branch if you create a new repository from within their interface.
The starter GitHub Actions have just been rejigged to use a "$default_branch" token instead of a hard-coded master branch.
So there is work done on migrating away from master at least.
Activity
ben commentedon Jul 15, 2020
I'm absolutely on board with this kind of effort, and I'd love to take steps towards removing this terminology. There are parts of this which are under our control, and parts that are not. Until Git changes the default branch name (or lets you customize it for
git init), the word "master" will need to continue to appear in the text.Here are the things we can do in the meantime:
git initgit branch -mfor existing reposgit initin examplesWe do need to be careful to protect the newbie experience though. I don't want someone to get frustrated because they ran
git initand the example text assumes that the fresh default branch is calledmainwith no explanation.HonkingGoose commentedon Jul 16, 2020
It turns out that changing from
mastertomainis not as hard as it appears:git branch -m master maingit push -u origin mainSo that takes care of the problem if you're only using the repository as a backup for your own work.
If you collaborate with others, the people with a fork/clone will need to make some changes too:
Yeah, running
git initfrom your local terminal will still give amastermain branch.Making a new repo from within GitHub also still gives a
masterbranch as of today.I don't know when GitHub themselves will use the
mainbranch if you create a new repository from within their interface.The starter GitHub Actions have just been rejigged to use a "$default_branch" token instead of a hard-coded
masterbranch.So there is work done on migrating away from
masterat least.Sources:
https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx
actions/starter-workflows#590