set main branch for git init code example Example: set default branch to main on git init $ git config --global init.defaultBranch main