Last Updated: October 11, 2021
·
481
· clawfire

Quickly rename a git branch

Sometimes you make an error on your branch and see it after some commit. Don't panic, here how you can rename a branch :

git branch -m [oldName] [newName]

Also, did you already push the update on a distant server ? Just delete and repush the branch :

git push original :[oldName]
git push origin [newName]

That's it !