Sometimes by mistake we have a situation to rename the remote and local git branch name. Below steps will help to do same –
1. Rename your local branch.
1 2 |
git branch -m new-name git branch -m old-name new-name |
2. Delete the old-name remote branch and push the new-name local branch.
1 |
git push origin :old-name new-name |
3. Reset the upstream branch for the new-name local branch.
Switch to the branch and then:
1 |
git push origin -u new-name |