When you initiate a new repository, the name of the Main Branch is automatically set as master
.
Many people have become aware that the terminology master/slave should be replaced with something more appropriate.
Most companies choose to name the main Branch as main.
So let’s do that!
Prefer a video guide instead? Check this out:
Set initial branch name
In the command line run the following command:
git config --global init.defaultBranch main
This command will add a new configuration to your ~/.gitconfig
file.
From now on, when you initiate a new repository, the name of the main branch will be main.