Renaming git branch is handy and must be handled carefully.
While renaming git branch consider the following steps
- Rename your git branch locally
git branch -m old_branch new_branch
- Next delete your old branch from remote/origin
git push origin :old_branch
- Push/set-upstream to your newly/renamed branch.
git push --set-upstream origin new_branch
Probably this will help you, and save your time.
Happy Learning 🙂