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 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"]Link a pull request to an issue
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/closedfix/fixes/fixedresolve/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
- Open the issue or pull request that is the duplicate.
- In a new comment, type
Duplicate offollowed by the number of the canonical issue or pull request (for exampleDuplicate of #42). - 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 useowner/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.