How to rename a local GIT Branch?


If you want to rename the branch you are currently working on, hit below command:

git branch -m <newBranchName>

If the branch you want to rename is different from your current branch, then hit below command

git branch -m <oldBranchName> <newBranchName>

To check your current branch, hit below command. You can see the current branch highlighted followed by an asterisk.

git branch

The same question has also been asked here as well @ StackOverflow.

Buy Me A Coffee