Git: rename a branch
If you’re currently on that branch you can rename it using:
Otherwise if you’re not on that branch use:
If you like bash/zsh aliases you can make it so the name you pass in is dynamic and make a generic command for renaming a branch:
If you like bash/zsh aliases you can make it so the name you pass in is dynamic. Read more about git branch flags here. Read more about bash aliases here.