Skip to content

Instantly share code, notes, and snippets.

@josemarcosrf
Created November 28, 2018 10:30
Show Gist options
  • Save josemarcosrf/9d7f29c2388f6202ff1a450dafda97ec to your computer and use it in GitHub Desktop.
Save josemarcosrf/9d7f29c2388f6202ff1a450dafda97ec to your computer and use it in GitHub Desktop.
Rename git branch
# from the branch to rename
git branch -m new-name
# delete the old name-branch and push the new one
git push origin :old-name new-name
# reset the upstream with the new local name one
git push origin -u new-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment