rename branch to master code example
Example 1: git rename master to main
$ git branch -m master main
Example 2: rename branch to main
$ git branch -m master main
or create a new one
$ git checkout -b main
$ git branch -m master main
$ git branch -m master main
or create a new one
$ git checkout -b main