git error rename branch code example Example 1: change local branch name git branch -m <newname> Example 2: git change branch name git branch –m old-name new-name