About pull request comments
You can comment on a pull request's Conversation tab to leave general comments, questions, or praise. You can also suggest changes that the pull request author can apply directly from your comment.
You can also comment on specific files or sections of a file in a pull request's Files changed tab as individual line or file comments, or as part of a pull request review. Adding line or file comments is a great way to discuss questions about implementation or give feedback to the author. See Pull request reviews.
See Reviewing proposed changes in a pull request.
注意
If you reply to a pull request via email, your comment will be added on the Conversation tab and will not be part of a pull request review.
To reply to an existing line or file comment, navigate to the comment on either the Conversation tab or Files changed tab. Then, add another comment below it.
提示
- Pull request comments support the same formatting as regular comments on GitHub, such as @mentions, emoji, and references.
- You can add reactions to comments in pull requests in the Files changed tab.
Adding comments to a pull request
-
在仓库名称下,单击 “Pull requests”****。

-
In the list of pull requests, click the pull request where you want to leave line comments.
-
在拉取请求上,单击“ Files changed”****。

-
将鼠标悬停在要添加评论的代码行上方,然后单击蓝色的评论图标。

-
或者,可以在多行中添加批注。 若要选择一系列行,请单击要批注的第一行的行号,然后向下拖动到最后一行,或按住 Shift 并单击最后一行号。 然后,可以单击要批注的最后一行上的蓝色批注图标。 或者,可以单击要对其添加注释的第一行旁边的蓝色批注图标,然后向下拖动到要对其添加批注的最后一行。
-
在评论字段中输入您的评论。
-
(可选)要提供有关对一行或多行进行特定更改的建议,请单击“”,然后对建议块中的文本进行编辑。

-
若要直接对文件进行注释,请单击文件右侧的 ,然后键入注释。

-
When you're done:
-
If you only want to add this one comment, click Add single comment.
-
If you want to add multiple comments, click Start a review, then continue adding comments.
When you're finished, click Finish your review, leave a summary of your review, and click Submit review.
-
Anyone watching the pull request or repository will receive a notification of your comments. Batching your comments avoids sending multiple notifications.
If you are commenting on a pull request created by Copilot, batching your comments prevents Copilot from starting to work on individual comments before you have completed your review. See 启动GitHub Copilot会话.
Resolving conversations
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.
The entire conversation will collapse and be marked as resolved. This makes it easier to find conversations that still need to be addressed.
If the suggestion in a comment is out of your pull request's scope, you can open a new issue that tracks the feedback and links back to the original comment. See 创建议题.
Discovering and navigating conversations
You can discover and navigate to all the conversations in your pull request with the Conversations menu on the Files changed tab.
In this view, you can see which conversations are unresolved, resolved, and outdated. This makes it easy to discover and resolve conversations.
