Skip to content

Instantly share code, notes, and snippets.

@SkyzohKey
Created June 10, 2016 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SkyzohKey/c04b81e286a838da367e2265ac768bd5 to your computer and use it in GitHub Desktop.
Save SkyzohKey/c04b81e286a838da367e2265ac768bd5 to your computer and use it in GitHub Desktop.
Rename a git branch locally and remotly (don't do this for branch that have pull-request or that are worked on by multiple peoples)
git branch -m old-branch new-branch # Delete and recreate with the new name.
git push origin :old-branch # Delete the branch on origin remote.
git push origin new-branch # Push the renamed branch on origin remote.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment