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

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

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

Managing the default branch name for your repositories

本文内容

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."

您可以为新仓库设置默认分支名称。 For more information, see "Managing the default branch for your repositories," "Managing the default branch name for repositories in your organization," and "Enforcing repository management policies in your enterprise account."

If an enterprise owner has enforced a policy for the default branch name for your enterprise, you cannot set a default branch name for your organization. Instead, you can change the default branch for individual repositories. For more information, see "Enforcing repository management policies in your enterprise" and "Changing the default branch."

设置默认分支名称

  1. 在 GitHub 的右上角,单击您的个人资料照片,然后单击 Your profile(您的个人资料)
    个人资料照片
  2. 在您的个人资料页面左侧的“Organizations(组织)”下,单击组织的图标。
    组织图标
  3. 在组织名称下,单击 Settings(设置)
    组织设置按钮
  4. 在左边栏中,单击 Repository defaults(仓库默认值)
    仓库默认值选项卡
  5. 在“Repository default branch(仓库默认分支)”下,单击 Change default branch name now(立即更改默认分支名称)
    覆盖按钮
  6. 键入要用于新分支的默认名称。
    输入默认名称的文本框
  7. 单击 Update(更新)
    更新按钮

延伸阅读

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

此文档对您有帮助吗?

Privacy policy

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

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

做出贡献

或, 了解如何参与。