I had to do the following task to rename local and remote branch:
# Rename the local branch to the new name
git branch -m <old_name> <new_name>
# Delete the old remote branch
git push origin --delete <old_name>
# push to new remote branch - creates new remote branch
git push origin <new_name>
# set new remote branch as default remote branch for local branch
git branch --set-upstream-to=origin/<new_name> <new_name>