Created
May 9, 2019 07:51
-
-
Save eleev/7c47f5e1471366476378d9d4d32e674d to your computer and use it in GitHub Desktop.
Git branch renaming [local & remote]
This file contains 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 branch -m old_branch new_branch # First, rename branch locally | |
git push origin :old_branch # Then, delete the outdated branch | |
git push --set-upstream origin new_branch # And finally, push the new branch. Also, the new remote needs to be tracked, that is why we set set local branch to do so. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment