Files
30-seconds-of-code/snippets/rename-branch.md
Isabelle Viktoria Maciohsek ed2f41b0d8 Bake dates into snippets
2021-06-13 19:47:48 +03:00

390 B

title, tags, firstSeen, lastUpdated
title tags firstSeen lastUpdated
Rename a branch branch,intermediate 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`