rename main 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
Example 3: how to rename git branch fro master to main
git branch -m master main
git push -u origin main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
git push origin --delete master
Example 4: rename branch to main
$ git push -u origin main
Example 5: rename branch to main
$ git push origin --delete master