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