Skip to content

Instantly share code, notes, and snippets.

@moloccoGymondo
Created February 7, 2018 10:39
Show Gist options
  • Save moloccoGymondo/82f53aaec83ad8bcb9e4b256cf3e2866 to your computer and use it in GitHub Desktop.
Save moloccoGymondo/82f53aaec83ad8bcb9e4b256cf3e2866 to your computer and use it in GitHub Desktop.
Rename branch
git branch -m old-name new-name # Rename your local branch.
git push origin :old-name new-name # Delete the old-name remote branch and push the new-name local branch.
# Switch to the branch (if you are not there)
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