Files
30-seconds-of-code/snippets/rename-branch.md
Isabelle Viktoria Maciohsek aa8ddd1312 Add rename branch snippets
2021-04-05 09:48:16 +03:00

19 lines
304 B
Markdown

---
title: Rename a branch
tags: branch,beginner
---
Renames a local branch.
- Use `git branch -m <old-name> <new-name>` to rename `<old-name>` to `<new-name>`.
```sh
git branch -m <old-name> <new-name>
```
```sh
git checkout master
git branch -m patch-1 patch-2
# Renames `patch-1` to `patch-2`
```