Skip to content

Instantly share code, notes, and snippets.

@achmadfatoni
Last active August 26, 2016 04:07
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 achmadfatoni/d6b3b96eb26dae811de2c59b8428f3ab to your computer and use it in GitHub Desktop.
Save achmadfatoni/d6b3b96eb26dae811de2c59b8428f3ab to your computer and use it in GitHub Desktop.
Git rename local branch

If you want to rename a branch while pointed to any branch, do :

git branch -m <oldname> <newname>

If you want to rename the current branch, you can do:

git branch -m <newname>

A way to remember this, is -m is for "move" (or mv), which is how you rename files.

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