how to change branch name master to main in git code example Example: git rename master to main $ git branch -m master main