Managing the default branch name for your repositories

You can set a default branch name for all new repositories that you create.

In this article

Did this doc help you?

About the default branch name

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 github/renaming.

If you have already renamed the default branch, GitHub will automatically redirect links on that contain a deleted master branch name to the equivalent link on the repository's default branch.

Setting the default branch name

  1. In the upper-right corner of any page, click your profile photo, then click Settings.
    Settings icon in the user bar
  2. In the left sidebar, click Repositories.
    Repositories tab
  3. Under "Repository default branch", click Change default branch name now.
    Override button
  4. Type the default name that you would like to use for new branches.
    Text box for entering default name
  5. Click Update.
    Update button

Further reading

Did this doc help you?