Skip to content

Instantly share code, notes, and snippets.

@aliaghdam
Created September 21, 2017 13:27
Show Gist options
  • Save aliaghdam/933cf932da00737c97f7d13711a1ec94 to your computer and use it in GitHub Desktop.
Save aliaghdam/933cf932da00737c97f7d13711a1ec94 to your computer and use it in GitHub Desktop.
Rename Git Branch - Rename Git Local Branch & Rename Git Remote Branch
# Rename your local branch
git branch -m old-name new-name
# Delete the old branch and push new
git push origin :old-name new-name
# Reset the upstream branch for the new-name local branch
git push origin -u new-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment