GIT – Rename a remote branch

It seems that the only way to rename a remote branch is remove it and create it again. So before you start you need to be sure that all code has been committed and pushed to the branch and that you have the latest versions.

1. Rename the branch locally:
   git branch -m <old_name> <new_name>

2. Remove the remote branch:
   git push origin :<old_name>

3. Push the newly named branch to remote:
   git push origin <new_name>