审查拉取请求中的建议更改
在拉取请求中,您可以审查和讨论提交、更改的文件以及基本和比较分支中文件之间的区别(或“差异”)。
本文内容
关于审查拉取请求
您可以在拉取请求中每次审查一个文件的更改。 在审查拉取请求中的文件时,可对特定更改进行个别评论。 在按需要审查多个文件后,您可以在摘要评论中提交审查,以批准拉取请求或申请其他更改。
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."
开始审查
-
Under your repository name, click Pull requests.
-
In the list of pull requests, click the pull request you'd like to review.
-
On the pull request, click Files changed.
-
Hover over the line of code where you'd like to add a comment, and click the blue comment icon.
-
In the comment field, type your comment.
-
Optionally, to suggest a specific change to the line, click , then edit the text within the suggestion block.
-
完成后,单击 Start a review(开始审查)。 如果已开始审查,您可以单击 Add review comment(添加审查注释)。
提交审查之前,您的行注释为待处理状态并且仅对您可见。 您可以在提交审查之前随时编辑待处理的注释。 要取消待处理的审查(包括所有其待处理的注释),请在 Conversation(对话)选项卡中向下滚动到时间表的末尾,然后单击 Cancel review(取消审查)。
提交审查
完成审查拉取请求中需要查看的所有文件后,提交您的审查。
-
On the pull request, click Files changed.
-
Above the changed code, click Review changes.
-
Type a comment summarizing your feedback on the proposed changes.
-
选择您想要留下的审查类型:
- 选择 Comment(注释)留下一般反馈而不明确批准更改或请求其他更改。
- 选择 Approve(批准)提交反馈并批准合并拉取请求中提议的更改。
- 选择 Request changes(请求更改)提交在拉取请求合并之前必须解决的反馈。
-
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.
延伸阅读
- “关于拉取请求审查”
- "关于拉取请求的必要审查"
- “批准需要审查的拉取请求”
- "评论拉取请求"
- "按审查状态过滤拉取请求"