Skip to content

Instantly share code, notes, and snippets.

@ziishaned
Last active February 1, 2018 06:42
Show Gist options
  • Save ziishaned/b5f97cfd9a84a8953462aae9ec7c6917 to your computer and use it in GitHub Desktop.
Save ziishaned/b5f97cfd9a84a8953462aae9ec7c6917 to your computer and use it in GitHub Desktop.
Git commands

How to rename a local Git 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