Skip to content
Source
Sign inSign up

Edit titles and comments

Issues and pull requests / Issues

Edit the title, the description and comments

You posted an issue or a comment, and then you saw a typo, a wrong link or a missing step. Fix the text in place, so that you do not post a second comment to correct the first.

6 min read

You need to be the author of the text, or to have the triage role or more on the repository. The Edit button shows only to the people who can change the text.

1. Fix the title

  1. Open the issue or the pull request.
  2. Next to the title, click Edit.
  3. Change the text.
  4. Press Enter, or click Save.

To stop without a change, press Escape, or click Cancel. An empty title cannot be saved.

The issue title in edit mode: a text field with the title, and the Cancel and Save buttons next to it

2. Fix the description or a comment

  1. In the header of the description or of the comment, click Edit.
  2. Change the text. The editor has the same toolbar and preview as a new comment. See Write comments and descriptions.
  3. Click Save. To stop without a change, click Cancel.

After a save, the header shows edited after the time. Hold the pointer on it to see when the text changed. Click it to see the earlier versions: see Read the earlier versions.

The description of an issue open in the editor, with the toolbar, the text and its live preview side by side, and the Cancel and Save buttons

Note

Each comment on the page has an Edit button: comments in the conversation, the summary of a review, line comments and their replies.

3. If someone else changed the text first

Two people can edit the same text at the same time. If the other person saves first, your save is refused, and you see Someone changed this since you started.

  1. Copy what you need from your draft. It stays in the editor, so you lose nothing.
  2. To see the other version, click Load the new text. It replaces your draft.

4. Read the earlier versions

Each edit keeps the text from before it as an earlier version. To see them:

  1. In the header of the comment or the description, click edited.
  2. Read the Edit history dialog. It lists the earlier versions, newest first.

Each version shows who wrote it, when it was replaced, and what changed in the version after it.

  • Everyone who can read the comment can read its earlier versions.
  • The forge keeps the 50 newest earlier versions of each comment and each description. The next edit deletes the oldest one.
  • A version that screening held shows only to the people who can read held comments.
  • The history needs a connection.

5. Delete an earlier version

You pasted a password or a token into a comment, then edited it out. The earlier version still holds it, and everyone who reads the comment can open it. Delete that version.

You need to be the author of the text, or an admin of the repository.

  1. In the header of the comment or the description, click edited.
  2. Find the version, and click Delete this version.
  3. In the dialog, click Delete version.

In a terminal, list the versions to get the id of the version, then delete it:

src comment history 345
src comment delete-version 88

For the description of issue or pull request 12, run src comment history --item 12.

Caution

A deleted version does not come back. The text now and the other versions stay. Someone could have read the secret before you deleted the version, so replace the secret too.

On an item from GitHub, GitHub keeps its own edit history. Delete the version on GitHub too.

When you cannot edit

  • A locked conversation: only people with write access edit comments there. See Lock a heated conversation.
  • Screening: if screening reads your comments before others see them, it reads your edited text again. Until it ends, only you and the maintainers see the comment or the item.
  • No connection: on items created in Source, your edit is saved in the browser and sent when you are online again. See Work on issues offline. Items from GitHub need a connection.
  • GitHub sync: on an item from GitHub, your edit goes to GitHub first, with your own GitHub account. See Sync with GitHub.

Done

  • The fixed title shows at the top of the page and in the issues list.
  • The fixed comment shows the new text, with edited after its time.
  • Nobody loses a draft when two people edit at the same time.
  • edited opens the earlier versions, and an old version with a secret can go.

To hide or delete a whole comment, see Hide or delete a comment.

Later: REST and MCP

An agent or a script edits a comment with the same rules. The REST paths are under /api/v1/repos/{owner}/{repo}.

You want toRESTMCP toolsrc
Edit the title or the descriptionPATCH /issues/{n}, with { "title", "body" }update_issuesrc issue edit 12 --title "..." --body "..."
Edit a commentPATCH /issues/comments/{id}, with { "body" }edit_commentsrc issue comment 12 --edit-last --body "..."
List the earlier versions of a commentGET /issues/comments/{id}/revisionslist_comment_revisions, with comment_idsrc comment history 345
List the earlier versions of the descriptionGET /issues/{n}/revisionslist_comment_revisions, with numbersrc comment history --item 12
Delete an earlier versionDELETE /issues/revisions/{id}delete_comment_revisionsrc comment delete-version 88
  • The comment id is the id of the comment in the timeline of GET /issues/{n}. The comment route works for the comments of pull requests too: review summaries, line comments and replies.
  • PATCH /issues/comments/{id} answers { "ok": true }. It answers 404 when the comment does not exist, 403 when you cannot edit it, and 422 for an empty body. A review summary can be empty.
  • --edit-last edits your newest comment in the conversation. It does not edit reviews or line comments. For a pull request, run src pr comment 7 --edit-last --body "...".
  • An agent cannot edit a comment that is on GitHub. It can edit its own comments that are only here.
  • The version routes give each version as { id, body, editor, createdAt }, newest first. editor is the username of the person who wrote the version. src comment history 345 --json id,body,editor,createdAt gives the same fields.

Use the REST API has the other routes.