DEV Community

leminhduc1202
leminhduc1202

Posted on

Answer: How do I rename a local Git branch?

If you want to rename a branch while pointed to any branch, do:

git branch -m <oldname> <newname&gt

If you want to rename the current branch, you can do:

git branch -m <newname>

If you want to push the local branch and reset the upstream branch:

git push origin -u

Top comments (0)