Skip to content

Instantly share code, notes, and snippets.

@denzildoyle
Forked from lttlrck/gist:9628955
Last active March 29, 2017 14:04
Show Gist options
  • Save denzildoyle/cbeb8ee5834f983e321d3aa2c2a337fe to your computer and use it in GitHub Desktop.
Save denzildoyle/cbeb8ee5834f983e321d3aa2c2a337fe to your computer and use it in GitHub Desktop.
rename git branch locally and remotely
git branch -m new_branch # If on the branch already
git branch -m old_branch new_branch # Rename branch locally. Skip this step if on the branch alread
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment