Created
August 22, 2016 23:58
-
-
Save cakriwut/85728034f3863863470eb8ef54b6a672 to your computer and use it in GitHub Desktop.
Rename git 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
REM rename branch in local | |
git branch -m old_branch new_branch | |
REM delete old branch in ORIGIN | |
git push origin :old_branch | |
REM set new branch to track ORIGIN | |
git push --set-upstream origin new_branch | |
REM re-sync remote branch to local, removing deleted remote | |
git fetch origin --prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment