change a local branch name in git code example Example 1: change local branch name git branch -m <newname> Example 2: change branch name $ git branch -m <new_name>