-
-
Save jameswilson/cbe1ab3d04b8723bd1c26005b01cb5a3 to your computer and use it in GitHub Desktop.
rename git branch locally and remotely
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout old_branch_name # Ensure you're on the local branch. | |
git branch -M new_branch_name # Rename branch locally. | |
git branch --unset-upstream # unset | |
git push origin :old_branch_name # Delete the old branch | |
git push -u origin new_branch_name # Push the new branch, set local branch to track the new remote |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment