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

审查拉取请求中的建议更改

在拉取请求中,您可以审查和讨论提交、更改的文件以及基本和比较分支中文件之间的区别(或“差异”)。

本文内容

关于审查拉取请求

您可以在拉取请求中每次审查一个文件的更改。 在审查拉取请求中的文件时,可对特定更改进行个别评论。 在按需要审查多个文件后,您可以在摘要评论中提交审查,以批准拉取请求或申请其他更改。

Tip: You can find a pull request where you or a team you're a member of is requested for review with the search qualifier review-requested:[USERNAME] or team-review-requested:[TEAMNAME]. For more information, see "Searching issues and pull requests."

开始审查

  1. Under your repository name, click Pull requests.

    议题和拉取请求选项卡选择

  2. In the list of pull requests, click the pull request you'd like to review.

  3. On the pull request, click Files changed.

    Files Changed tab

  4. Hover over the line of code where you'd like to add a comment, and click the blue comment icon.

Blue comment icon

  1. In the comment field, type your comment.

    Comment field

  2. Optionally, to suggest a specific change to the line, click , then edit the text within the suggestion block.

    Suggestion block

  3. 完成后,单击 Start a review(开始审查)。 如果已开始审查,您可以单击 Add review comment(添加审查注释)

    开始审查按钮

提交审查之前,您的行注释为待处理状态并且仅对您可见。 您可以在提交审查之前随时编辑待处理的注释。 要取消待处理的审查(包括所有其待处理的注释),请在 Conversation(对话)选项卡中向下滚动到时间表的末尾,然后单击 Cancel review(取消审查)

取消审查按钮

提交审查

完成审查拉取请求中需要查看的所有文件后,提交您的审查。

  1. On the pull request, click Files changed.

    Files Changed tab

  2. Above the changed code, click Review changes.

    Review changes button

  3. Type a comment summarizing your feedback on the proposed changes.

    Review summary comment window

  4. 选择您想要留下的审查类型:

    具有审查选项的单选按钮

    • 选择 Comment(注释)留下一般反馈而不明确批准更改或请求其他更改。
    • 选择 Approve(批准)提交反馈并批准合并拉取请求中提议的更改。
    • 选择 Request changes(请求更改)提交在拉取请求合并之前必须解决的反馈。
  5. Click Submit review.

提示

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

延伸阅读

问问别人

找不到要找的内容?

联系我们