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

git branch -m <oldname> <newname>

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 <newname>

And finally if you want to Delete the remote branch:

git push origin --delete <oldname>

--

--

Sundaram Dubey
Sundaram Dubey

Written by Sundaram Dubey

SDE @Swiggy | Ex-Paytm | HBTU CSE’21 | GSoC ’21 @DIAL | Google CodeIn mentor’20

No responses yet