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