I usually create new repos through GitHub or another central repo’s system, where it defaults to calling the main branch main. But I did recently create a new repo with my local Git’s git init, and had to deal with a master branch on a completely new repo for the first time in a while. It was actually kinda a weird experience.
Yeah, current company has their internal git server default to master and it was a little odd first time I created a new repo. Luckily all the CI templates can recognize either name so I just switched it.
I usually create new repos through GitHub or another central repo’s system, where it defaults to calling the main branch
main. But I did recently create a new repo with my local Git’sgit init, and had to deal with amasterbranch on a completely new repo for the first time in a while. It was actually kinda a weird experience.You don’t have to deal with shit if you don’t want to.
If you haven’t already found it, you need to change your global git config (
~/.gitconfig):git config --global init.defaultBranch main(or whatever you want to call it; e.g.
daddywould work too)For any existing repositories you want to run the following command in the existing repository root (
./.git/config):git config set init.defaultBranch maindaddybranch.Love it.
Yeah, current company has their internal git server default to master and it was a little odd first time I created a new repo. Luckily all the CI templates can recognize either name so I just switched it.