Created
December 7, 2019 12:22
-
-
Save dizzersee/a3cdaa57818f7def8206f97aa957ff8d to your computer and use it in GitHub Desktop.
Git rename branch
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
Locally: | |
``` | |
git checkout oldname | |
git branch -m "newname" | |
git push origin :oldname newname | |
git push origin -u newname | |
``` | |
In remote: | |
``` | |
git pull | |
git checkout newname | |
git branch --unset-upstream | |
git pull origin newname | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment