How do I rename branch on the GitHub website?

I think you can, just create a new branch with the new name, and delete the old one on github.

More detail you can see here.


It is not possible to rename a branch from the Github website. You will need to do the following -

Setup your Git Environment

Follow this - https://help.github.com/articles/set-up-git

Rename branch locally & on Github

git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote


I just did it without downloading any code to my laptop and using only the GitHub site. The solution looks the same as @swcool’s, but I want to add about the default branch.
In my case, the name of the renaming branch did not exist.

  1. Change the default branch (to the old branch you want to rename)

  2. Create a new branch (with a new name)

    This action will copy all the contents of the default branch (the branch with the old name) to the new branch (with a new name). At this time, you have two branches with the same code.

  3. Change the default branch (to the new one with a new name)

  4. Delete the old branch