How to rename a branch in Git?
Rename your local
foo branch with
git branch -m foo bar
Remember this will add the new branch with you
push, but it won’t delete the old
foo remote branch.
-f --mirror to rename the branch on the remote:
git push -f --mirror
If you just want to remove your remote foo branch, just use:
git push origin :foo