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