Upgrade git
The ability to use an alternate name for the primary branch began in git release 2.28. There are several ways to update git. I used Homebrew on a Mac.
$ git --version git version 2.17.2 (Apple Git-113) $ brew install git ... $ git --version
Configure main as the default repository for all new repos
$ git config --global init.defaultBranch main
This updates ~/.git file and adds the following lines...
[init] defaultBranch = main
Create repo with new default branch name
$ mkdir myapp $ cd myapp $ git init $ git status