rename current branch git command code example Example: git rename local branch git branch -m <oldname> <newname>