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