Skip to content

Instantly share code, notes, and snippets.

@aliaghdam
Created September 21, 2017 13:27
Show Gist options
  • Save aliaghdam/9e6f99675ecacc1688a8e252c87fa9c5 to your computer and use it in GitHub Desktop.
Save aliaghdam/9e6f99675ecacc1688a8e252c87fa9c5 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