Created
September 21, 2017 13:27
-
-
Save aliaghdam/9e6f99675ecacc1688a8e252c87fa9c5 to your computer and use it in GitHub Desktop.
Rename Git Branch - Rename Git Local Branch & Rename Git Remote 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
# Rename your local branch | |
git branch -m old-name new-name | |
# Delete the old branch and push new | |
git push origin :old-name new-name | |
# Reset the upstream branch for the new-name local branch | |
git push origin -u new-name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment