Files
30-seconds-of-code/snippets/rename-branch.md
Angelos Chalaris fb4b6fbc8e Update covers
2023-02-16 22:24:37 +02:00

388 B

title, tags, cover, firstSeen, lastUpdated
title tags cover firstSeen lastUpdated
Rename a branch branch bug 2021-04-05T09:48:16+03:00 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`