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
If you are on the branch you want to rename:
git branch -m new-name
If you are on a different branch:
git branch -m old-name new-name
git push origin :old-name new-name
git push origin -u new-name
Or for a fast way to do that, you can use these 3 steps:
# Rename branch locally
git branch -m old_branch new_branch
# Delete the old remote branch
git push origin :old_branch
# Push the new branch, set local branch to track the new remote
git push --set-upstream origin new_branch
Referance: https://www.w3docs.com/snippets/git/how-to-rename-git-local-and-remote-branches.html