change branch main to master code example
Example 1: change master to main git
$ git branch -m master main
Example 2: How to switch from master to main git branch
git checkout master # to be sure you are on master branch
git push origin HEAD:main # and then push the current branch (as master) to main
-or-
git push --force origin HEAD:main