Skip to content

Instantly share code, notes, and snippets.

@elderfo
Created May 17, 2017 12:47
Show Gist options
  • Save elderfo/f0afe022f6784eefd50b7758320b5ac3 to your computer and use it in GitHub Desktop.
Save elderfo/f0afe022f6784eefd50b7758320b5ac3 to your computer and use it in GitHub Desktop.
Rename git branch
git branch -m old_branch new_branch # perform the rename
git push origin :old_branch # delete remote branch
git push --set-upstream origin new_branch # push to remote, setting the remote branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment