This tutorial will help you to rename a local git repository branch. Also, you can apply the same changes on the remote git repository.
Rename Local Git Branch
You can use -m option to rename a git branch. To rename the currently active branch just execute the following command with a new branch name.
git branch -m <new_branch_name>
To rename any other branch first define the name of the old branch name followed by the new branch name. For example:
git branch -m <old_branch_name> <new_branch_name>
Update Changes to Remote
Now, if you have already pushed the old branch to the remote. You can point a new branch to a new remote.
git push origin :<old_branch_name> git push origin <new_branch_name>:refs/heads/<new_branch_name>