Menu

gitpiper

Rename a branch git Code Snippet in 2025

branchintermediate

Last Updated: 25 April 2025

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`

git snippet similar to Rename a branch For You in April 2025

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2025 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️