Skip to content

Instantly share code, notes, and snippets.

@caiges
Created August 12, 2013 20:19
Show Gist options
  • Save caiges/6214747 to your computer and use it in GitHub Desktop.
Save caiges/6214747 to your computer and use it in GitHub Desktop.
Rename git branches.
# Stolen from http://sebgoo.blogspot.com/2012/04/git-rename-branch-local-and-remote.html
#rename local branch
git branch -m old-branch-name new-branch-name
#delete remote branch with old name
git push origin :old-branch-name
#create remote renamed branch
git push origin new-branch-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment