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

Managing disruptive comments

You can edit or delete comments on issues, pull requests, and commits.

本文内容

此文档对您有帮助吗?

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。

Hiding a comment

Anyone with write access to a repository can hide comments on issues, pull requests, and commits.

If a comment is off-topic, outdated, or resolved, you may want to hide a comment to keep a discussion focused or make a pull request easier to navigate and review. Hidden comments are minimized but people with read access to the repository can expand them.

Minimized comment

  1. Navigate to the comment you'd like to hide.

  2. In the upper-right corner of the comment, click , then click Hide.

    The horizontal kebab icon and comment moderation menu showing the edit, hide, delete options

  3. Using the "Choose a reason" drop-down menu, click a reason to hide the comment. Then click, Hide comment.

    Choose reason for hiding comment drop-down menu

Unhiding a comment

Anyone with write access to a repository can unhide comments on issues, pull requests, and commits.

  1. Navigate to the comment you'd like to unhide.
  2. In the upper-right corner of the comment, click Show comment.
    Show comment text
  3. On the right side of the expanded comment, click , then Unhide.
    The horizontal kebab icon and comment moderation menu showing the edit, unhide, delete options

Editing a comment

Anyone with write access to a repository can edit comments on issues, pull requests, and commits.

It's appropriate to edit a comment and remove content that doesn't contribute to the conversation and violates your community's code of conduct.

When you edit a comment, note the location that the content was removed from and optionally, the reason for removing it.

Anyone with read access to a repository can view a comment's edit history. The edited dropdown at the top of the comment contains a history of edits showing the user and timestamp for each edit.

Comment with added note that content was redacted

Comment authors and anyone with write access to a repository can also delete sensitive information from a comment's edit history. For more information, see "Tracking changes in a comment."

  1. Navigate to the comment you'd like to edit.
  2. In the upper-right corner of the comment, click , then click Edit.
    The horizontal kebab icon and comment moderation menu showing the edit, hide, delete, and report options
  3. In the comment window, delete the content you'd like to remove, then type [REDACTED] to replace it.
    Comment window with redacted content
  4. At the bottom of the comment, type a note indicating that you have edited the comment, and optionally, why you edited the comment.
    Comment window with added note that content was redacted
  5. Click Update comment.

Deleting a comment

Anyone with write access to a repository can delete comments on issues, pull requests, and commits. Organization owners, team maintainers, and the comment author can also delete a comment on a team page.

Deleting a comment is your last resort as a moderator. It's appropriate to delete a comment if the entire comment adds no constructive content to a conversation and violates your community's code of conduct.

Deleting a comment creates a timeline event that is visible to anyone with read access to the repository. However, the username of the person who deleted the comment is only visible to people with write access to the repository. For anyone without write access, the timeline event is anonymized.

Anonymized timeline event for a deleted comment

If a comment contains some constructive content that adds to the conversation in the issue or pull request, you can edit the comment instead.

Note: The initial comment (or body) of an issue or pull request can't be deleted. Instead, you can edit issue and pull request bodies to remove unwanted content.

  1. Navigate to the comment you'd like to delete.
  2. In the upper-right corner of the comment, click , then click Delete.
    The horizontal kebab icon and comment moderation menu showing the edit, hide, delete, and report options
  3. Optionally, write a comment noting that you deleted a comment and why.

此文档对您有帮助吗?

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。