Bitzu

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.

Source: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue

Practice questions

Single choice

Which text in a pull request description closes issue 42 when the PR is merged into the default branch?

  1. Closes #42
  2. See #42
  3. Related to #42
  4. Mentions #42
Show answer

Answer: A. Closes #42

Closes is a closing keyword. The other phrases only reference the issue without closing it.

Select all that apply

Which of these are valid closing keywords?

  1. fixes
  2. resolves
  3. finishes
  4. closes
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More GH-900 topics in this module