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

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2019-10-16. 即使针对重大安全问题,也不会发布补丁。 For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

关于拉取请求审查

审查允许协作者评论拉取请求中提议的更改、审批更改或在拉取请求合并之前请求进一步更改。 仓库管理员可要求所有拉取请求在合并之前获得批准。

本文内容:

关于拉取请求审查

在拉取请求打开后,具有读取权限的任何人都可以审查和评论其提议的更改。 更多信息请参阅“审查拉取请求中提议的更改”。

仓库所有者和协作者可向具体的个人申请拉取请求审查。 组织成员也可向具有仓库读取权限的团队申请拉取请求审查。 更多信息请参阅“申请拉取请求审查”。

审查允许讨论提议的更改,帮助确保更改符合仓库的参与指南及其他质量标准。 您可以在 CODEOWNERS 文件中定义哪些个人或团队拥有代码的特定类型或区域。 当拉取请求修改定义了所有者的代码时,该个人或团队将自动被申请为审查者。 更多信息请参阅“关于代码所有者”。

包含行注释的拉取请求更改的标头

审查有三种可能的状态:

审查状态图像

提示

  • If required reviews are enabled and a collaborator with write, admin, or owner access to the repository submits a review requesting changes, the pull request cannot be merged until the same collaborator submits another review approving the changes in the pull request.
  • Repository owners and administrators can merge a pull request even if it hasn't received an approving review, or if a reviewer who requested changes has left the organization or is unavailable.
  • If both required reviews and stale review dismissal are enabled and a code-modifying commit is pushed to the branch of an approved pull request, the approval is dismissed. The pull request must be reviewed and approved again before it can be merged.
  • When several open pull requests each have a head branch pointing to the same commit, you won’t be able to merge them if one or both have a pending or rejected review.

您可以在“对话”时间表中查看拉取请求收到的所有审查,也可在拉取请求的合并框中按仓库所有者和协作者查看审查。

合并框中的审查图像

提示:使用搜索限定符 review-requested:[USERNAME]team-review-requested:[TEAMNAME] 可查找请求您或您所属团队审查的拉取请求。更多信息请参阅“搜索议题和拉取请求”。

解决对话

You can resolve a conversation in a pull request if you opened the pull request or if you have write access to the repository where the pull request was opened.

To indicate that a conversation on the Files changed tab is complete, click Resolve conversation.

Pull request conversation with Resolve conversation button

The entire conversation will be collapsed and marked as resolved, making it easier to find conversations that still need to be addressed.

Resolved conversation

必要的审查

Repository administrators can require that all pull requests receive a specific number of approving reviews from people with write or admin permissions in the repository or from a designated code owner before they're merged into a protected branch. 更多信息请参阅“关于受保护分支”。

When required reviews are enabled, anyone with access to the repository can approve changes in a pull request. However, you won't be able to merge your pull request until the required number of reviewers with write or admin permissions in the repository approve your pull request's changes in their review. For more information about repository permission levels, see "Repository permission levels for an organization." If review is required from a designated code owner and the pull request affects code that has a designated owner, approval from that owner is required.

更多信息请参阅“关于拉取请求的必需审查”。

Tip: If necessary, people with admin or write access to a repository can dismiss a pull request review. 更多信息请参阅“忽略拉取请求审查”。

延伸阅读

问问别人

找不到要找的内容?

联系我们