Git rename local branch
To rename git local branch, ensure you are in the current you want to rename, if not checkout the branch to rename and after rename the current branch like this :
git checkout <old-branch>
git branch -m <new-branch>
If you doesn’t checkout the branch to be renamed, you can change use -m
option flag (alias to --move
), like this :
git branch -m <old-branch> <new-branch>