Created
August 22, 2019 00:17
-
-
Save notbrain/e9961a810e5d0ed42665a3d345bf3486 to your computer and use it in GitHub Desktop.
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
OLD_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
NEW_BRANCH=$1 | |
git branch -m $OLD_BRANCH $NEW_BRANCH # Rename branch locally | |
git push origin :$OLD_BRANCH # Delete the old branch | |
git push --set-upstream origin $NEW_BRANCH # 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