Skip to content

Instantly share code, notes, and snippets.

@VincentRbbmnd
Last active February 15, 2017 11:23
Show Gist options
  • Save VincentRbbmnd/0dea945e8a39fa1f0cab5e8cb5788a66 to your computer and use it in GitHub Desktop.
Save VincentRbbmnd/0dea945e8a39fa1f0cab5e8cb5788a66 to your computer and use it in GitHub Desktop.
Rename git branch locally and remotely

Move to the branch you want to rename.

git branch -m new-branch or git branch -m old-branch new-branch

Set upstream for new branch.

git push --set-upstream origin new-branch

Delete old branch.

git push origin :old_branch or git push origin --delete old-branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment