Skip to content

Instantly share code, notes, and snippets.

@ahmadrosid
Last active September 15, 2019 06:12
Show Gist options
  • Save ahmadrosid/324d7dfb26466020ade8cdead60ccef0 to your computer and use it in GitHub Desktop.
Save ahmadrosid/324d7dfb26466020ade8cdead60ccef0 to your computer and use it in GitHub Desktop.
How to rename git branch

How to rename git branch

Rename branch locally

git branch -m old_branch new_branch            

Delete the old branch

git push origin :old_branch

Push the new branch, set local branch to track the new remote

git push --set-upstream origin new_branch   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment