change branch from master to main code example
Example 1: change master to main git
$ git branch -m master main
Example 2: rename branch to main
$ git push -u origin main
Example 3: rename branch to main
$ git push origin --delete master
$ git branch -m master main
$ git push -u origin main
$ git push origin --delete master