Back to Resources

How to use GitHub issue keywords

Post Fixes #N, Closes #N, and Duplicate of via gh --body-file, then prove stored keyword text with gh pr view --json. Skip merge.

What this covers

GitHub recognizes a small set of keywords in issue and pull request text so you can link work together or call out duplicates. Steps follow Using keywords in issues and pull requests.

Flowchart
4 linescompact
flowchart LR
    PR["Draft PR: 'Closes #42' in description"] --> Link["GitHub links Issue #42 to PR"]
    Link --> Merge["PR Merged into Default Branch"]
    Merge --> AutoClose["Issue #42 Automatically Closed"]
Rendered from Mermaid source with the native ZeroLabs diagram container.

To show a fix is in progress and automatically close the issue when the pull request merges, type one of these keywords followed by an issue reference, for example Closes #10 or Fixes octo-org/octo-repo#100:

  • close / closes / closed
  • fix / fixes / fixed
  • resolve / resolves / resolved

Put the phrase in the pull request description (or a commit message that lands on the default branch, per GitHub’s linking docs). After merge, the linked issue closes.

More detail: Linking a pull request to an issue.

Mark an issue or pull request as a duplicate

  1. Open the issue or pull request that is the duplicate.
  2. In a new comment, type Duplicate of followed by the number of the canonical issue or pull request (for example Duplicate of #42).
  3. Submit the comment.

GitHub treats that phrase as the duplicate marker. See Marking issues or pull requests as a duplicate.

Practical notes

  • Same-repo refs use #N; cross-repo refs use owner/repo#N.
  • Closing keywords are about linking + auto-close on merge: they are not a substitute for writing a clear PR description.
  • Duplicate marking is a comment convention GitHub recognizes; you still decide which thread stays open.
Share