我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

管理组织中仓库的默认分支名称

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

Managing the default branch name for your repositories

本文内容

此文档对您有帮助吗?

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。

About the default branch name

When a member of your organization creates a new repository in your organization, the repository contains one branch, which is the default branch. 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. For more information about the default branch, see "About branches."

You can set the name of the default branch for new repositories. For more information, see "Managing the default branch for your repositories," "Managing the default branch name for repositories in your organization," or "Enforcing a policy on the default branch name."

设置默认分支名称

  1. 在 GitHub 的右上角,单击您的个人资料照片,然后单击 Your profile(您的个人资料)

    个人资料照片

  2. 在您的个人资料页面左侧的“Organizations(组织)”下,单击组织的图标。

    组织图标

  3. 在组织名称下,单击 Settings(设置)

    组织设置按钮

  4. 在左边栏中,单击 Repository defaults(仓库默认值)

    仓库默认值选项卡

  5. 在“Repository default branch(仓库默认分支)”下,单击 Change default branch name now(立即更改默认分支名称)

    覆盖按钮

    注:如果企业所有者已强制实施默认名称策略,您将无法在此处更改它。 您将能够在单个仓库中设置默认分支。 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. 键入要用于新分支的默认名称。

    输入默认名称的文本框

  7. 单击 Update(更新)

    更新按钮

延伸阅读

  • /github/setting-up-and-managing-your-github-user-account/managing-the-default-branch-name-for-your-repositories

此文档对您有帮助吗?

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。