A newly created Git repo (git init
) has a default branch with the name master
. You can configure that name for all new repositories with the following command:
git config --global init.defaultBranch main
Now every new Git repository will automatically create a branch main
instead of master
.