I don\'t want to rename a remote branch, as described in Rename master branch for both local and remote Git repositories.
How can I rename a local branch wh
All of the previous answers are talking about git branch -m
. Of course, it's easy to operate, but for me, it may be a little hard to remember another Git command. So I tried to get the work done by the command I was familiar with. Yeah, you may guessed it.
I use git branch -b
. And if you don't want to save the old branch now you can execute git branch -D
to remove it.
I know it may be a little tedious, but it's easier to understand and remember. I hope it‘s helpful for you.