How To Rename a Branch in Git Locally and Remotely

Published Date Author: , Posted January 31st, 2018 at 6:56:50pm

Rename the old branch locally:
git branch -m oldBranch newBranch

Delete the old branch remotely:
git push origin :oldBranch

Push up the new branch, and make the local branch track with the new remote branch:
git push --set-upstream origin newBranch

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.