Scott covered this nicely with links to topics that show how master
originated from BitKeeper. There is evidence to strongly suggest it does pertain to the outdated, oppressive and perverse master/slave
metaphor, rather than master-copy
.
Edited 17th October 2020 (a bit late, I know!), Git now lets you set a default branch for init
, and GitHub now defaults to main
.
But if you have an older repository, some of these steps remain relevant.
So, here are the steps I followed:
Move Master to Main
Change the Default on Remote
Now depending on your remote tool, this might differ.
GitHub
- Assuming you've pushed
main
from the steps above. - Go to your Settings
- Go to the Branches section
- Change "Default branch" from
master
tomain
GitLab
- Assuming you've pushed
main
from the steps above. - Go to your Settings
- Go to the Repository section
- Change "Default Branch" from
master
tomain
BitBucket
- Assuming you've pushed
main
from the steps above. - Go to your Repository settings
- Go to the Repository details section
- Change "Main branch" from
master
tomain
then...
- Go to the Branching model section
- Change "Development branch" from
master
tomain
Git Now Lets You Name a Default Branch
Git Init Doesn't Let You Name a Default Branch
Edited 17th October 2020 Since git 2.28
, you've been able to change your default branch using built-in git
features.
git config --global init.defaultBranch main
Summary
Sort of past the point about caring which side you fall on here. The evidence is there. Be your own teacher, make the world a better place.
Top comments (4)
git 2.28 now allows to set a default branch name:
git config --global init.defaultBranch main
:)For a repository-wise intended name we can use:
git init --initial-branch=stable
Oh, thanks Michael! I'll update the post!
π€£
Good one.