renaming a branch from master to main code example
Example 1: git rename master to main
$ git branch -m master main
Example 2: rename branch to main
$ git push origin --delete master
$ git branch -m master main
$ git push origin --delete master