Rename Local and Remote branches in git

  1. rename local branch

Switch to branch then:

git branch -m <new name>

2. rename remote branch

git push origin :old-name new-name

3. Reset upstream branch to new-name

git push origin -u <new name>


Leave a Reply

Your email address will not be published. Required fields are marked *