How to rename a local git branch

Use the following command to rename a local git branch:

git branch -m <oldname> <newname>