Rename git branch

1 min read

  • git

Published on September 24, 2025

Rename local branch

gsw old-branch
git branch -m new-branch

git push -u origin new-branch # remote gets new branch

Delete old remote branch

You can remove the old branch from remote to avoid confusion.

git push origin --delete old-branch