change name branch github code example Example 1: git change branch name git branch –m old-name new-name Example 2: change branch name $ git branch -m <new_name>