Skip to content

Instantly share code, notes, and snippets.

@Joxebus
Created April 18, 2019 20:47
Show Gist options
  • Save Joxebus/fc5c2c332372eddf717dc36e9c4f1337 to your computer and use it in GitHub Desktop.
Save Joxebus/fc5c2c332372eddf717dc36e9c4f1337 to your computer and use it in GitHub Desktop.
Rename Branch
git branch -m new-name # If you are on the branch you want to rename
git branch -m old-name new-name # If you are on a different branch
git push origin :old-name new-name # Delete the old-name remote branch and push the new-name local branch.
git push origin -u new-name # Reset the upstream branch for the new-name local branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment