GH-900 ยท Collaboration tools
How do you link a pull request to an issue and organise work?
Closing keywords that link pull requests to issues, issue and PR templates, search filters, and assigning work.
Key points
- Put a closing keyword such as closes, fixes or resolves followed by the issue number in the pull request description; the issue closes when the PR is merged into the default branch.
- Templates pre-fill issues and PRs, search filters narrow lists, and assignees name owners.
Practice questions
Which text in a pull request description closes issue 42 when the PR is merged into the default branch?
- Closes #42
- See #42
- Related to #42
- Mentions #42
Show answer
Answer: A. Closes #42
Closes is a closing keyword. The other phrases only reference the issue without closing it.
Which of these are valid closing keywords?
- fixes
- resolves
- finishes
- closes
- completes
Show answer
Answer: A. fixes, B. resolves, D. closes
Close, fix and resolve (with their variants) are closing keywords; finishes and completes are not.
Closing keywords in a pull request description close the issue no matter which branch the PR targets.
Show answer
Answer: False
False. They are only interpreted when the pull request targets the default branch.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
