change master to main github code example
Example 1: change master to main git
$ 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: rename branch to main
$ git push -u origin main
Example 4: how to update master to main in github
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 5: Update master to main github
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a