When you create a repository on GitHub with content, the repository is initialized with a single branch, called the default branch. This branch is currently named
master, but you can set the default branch name to anything that makes sense for your development environment.
If you have admin permissions to a repository, you can change the default branch to another existing branch. For more information, see "Setting the default branch."
While you can rename your repository's existing default branch, GitHub plans to provide tools to simplify the process of renaming the default branch. For more information on these plans, see
If you have already renamed the default branch, GitHub will automatically redirect links on GitHub.com that contain a deleted
master branch name to the equivalent link on the repository's default branch.
- In the upper-right corner of any page, click your profile photo, then click Settings.
- In the left sidebar, click Repositories.
- Under "Repository default branch", click Change default branch name now.
- Type the default name that you would like to use for new branches.
- Click Update.