change name of branch github

git branch -m oldname newname
git push origin :old-name-of-branch-on-github
git branch -m old-name-of-branch-on-github new-name-for-branch-you-want
git push origin new-name-for-branch-you-want
On GitHub, navigate to the main page of the repository.
Under your repository name, click Settings.
In the left menu, click Branches.
Under "Default branch", to the right of the default branch name, click .
Use the drop-down, then click a branch name.
Click Update.

Also in C++: