Back to Resources

How to use GitHub issue keywords

Automatically close GitHub issues on merge using Fixes, Closes, and Resolves keywords. Link commit messages and PR bodies cleanly in Cursor and GitHub CLI.

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.

Architecture Flow
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"]

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.

FAQ

Why didn't my GitHub issue close automatically when I referenced 'Fixes #12' in a commit? Ensure your pull request is merged into the default repository branch (e.g., main). Issues only close automatically when commits containing closing keywords are merged into default branches, not feature branches.

Share