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

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2020-05-23. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持

文章版本: Enterprise Server 2.17

Creating a default community health file

You can create default community health files, such as CONTRIBUTING and CODE_OF_CONDUCT. Default files will be used for any public repository owned by the account that does not contain its own file of that type.

本文内容

关于默认社区健康文件

You can add default community health files to the root of a public repository called .github that is owned by an organization.

GitHub Enterprise will use and display default files for any public repository owned by the account that does not have its own file of that type in any of the following places:

  • 仓库的根目录
  • .github 文件夹
  • docs 文件夹

例如,在不含自有 CONTRIBUTING 文件的公共仓库中创建议题或拉取请求的人将会看到指向默认 CONTRIBUTING 文件的链接。 If a repository has any files in its own .github/ISSUE_TEMPLATE folder none of the contents of the default .github/ISSUE_TEMPLATE folder will be used.

默认文件不包含在各个仓库的克隆、包或下载中,因为它们只存储在 .github 仓库中。

支持的文件类型

You can create defaults in your organization for the following community health files:

Community health file描述
CONTRIBUTING.mdA CONTRIBUTING file communicates how people should contribute to your project. For more information, see "Setting guidelines for repository contributors."
Issue and pull request templatesIssue and pull request templates customize and standardize the information you'd like contributors to include when they open issues and pull requests in your repository. For more information, see "About issue and pull request templates."
SUPPORT.mdA SUPPORT file lets people know about ways to get help with your project. 更多信息请参阅“为项目添加支持资源”。

You cannot create a default license file. 必须将许可文件添加到各个仓库中,以便在克隆、打包或下载项目时包含该文件。

创建用于默认文件的仓库

  1. 在任何页面的右上角,使用 下拉菜单选择 New repository(新建仓库)
    带有创建新仓库选项的下拉菜单
  2. Use the Owner drop-down menu, and select the organization you want to create default files for.
    所有者下拉菜单
  3. 键入 .github 作为仓库的名称,可选择键入说明。
    创建仓库字段
  4. 选择让仓库公开。
    用于选择机密或公开状态的单选按钮
  5. 选择 Initialize this repository with a README(使用自述文件初始化此仓库)
    使用自述文件初始化此仓库复选框
  6. 单击 Create repository(创建仓库)
  7. 在仓库中,创建一个受支持的社区健康文件。 Issue templates must be in a folder called .github/ISSUE_TEMPLATE. 所有其他支持的文件必须在仓库的根目录中。 更多信息请参阅“创建新文件”。

问问别人

找不到要找的内容?

联系我们