Files
30-seconds-of-code/snippets/rename-branch.md
2023-04-28 22:15:54 +03:00

368 B

title, type, tags, cover, dateModified
title type tags cover dateModified
Rename a branch snippet
branch
bug 2021-04-13T21:10:59+03:00

Renames a local branch.

  • Use git branch -m <old-name> <new-name> to rename <old-name> to <new-name>.
git branch -m <old-name> <new-name>
git checkout master
git branch -m patch-1 patch-2
# Renames `patch-1` to `patch-2`