Managing the default branch name for repositories in your organization

You can set the default branch name for repositories that members create in your organization.

In this article

Did this doc help you?

About the default branch name

When a member of your organization creates a new repository, GitHub will create a single branch and set it as the repository's default branch. GitHub currently names the default branch master, but you can set the default branch to be named 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 top right corner of GitHub, click your profile photo, then click Your profile.

    Profile photo

  2. On the left side of your profile page, under "Organizations", click the icon for your organization.

    organization icons

  3. Under your organization name, click Settings.

    Organization settings button

  4. In the left sidebar, click Repository defaults.

    Repository defaults tab

  5. Under "Repository default branch", click Change default branch name now.

    Override button

    Note: If your enterprise owner has enforced a policy for the default name, you won't be able to change it here. You will be able to set the default branch on individual repositories. For more information, see "Enforcing a policy on the default branch name" and "Setting the default branch."

  6. Type the default name that you would like to use for new branches.

    Text box for entering default name

  7. Click Update.

    Update button

Further reading

Did this doc help you?