Note: The special keywords in a pull request description are interpreted when the pull request targets the repository's default branch. However, if the PR's base is any other branch, then these keywords are ignored, no links are created and merging the PR has no effect on the issues. If you want to link a pull request to an issue using a keyword, the PR must be on the default branch.
リンクされたIssueとプルリクエストについて
You can link an issue to a pull request manually or using a supported keyword in the pull request description.
プルリクエストが対処するIssueにそのプルリクエストにリンクすると、コラボレータは、誰かがそのIssueに取り組んでいることを確認できます。
リンクされたプルリクエストをリポジトリのデフォルトブランチにマージすると、それにリンクされているIssueは自動的にクローズされます。 For more information about the default branch, see "Changing the default branch."
手動でプルリクエストをIssueにリンクする
リポジトリへの書き込み権限があるユーザなら誰でも、手動でプルリクエストをIssueにリンクできます。
手動で1つのプルリクエストごとに最大10個のIssueをリンクできます。 Issueとプルリクエストは同じリポジトリになければなりません。
- GitHubで、リポジトリのメインページにアクセスしてください。
- リポジトリ名の下にある Pull requests(プルリクエスト)をクリックしてください。

- プルリクエストのリストで、Issueにリンクしたいプルリクエストをクリックします。
- 右のサイドバーで、[Linked issues] をクリックします。
![右サイドバーの [Linked issues]](/web/20201019101035im_/https://docs.github.com/assets/images/help/pull_requests/linked-issues.png)
- プルリクエストにリンクするIssueをクリックします。

キーワードを使用してプルリクエストをIssueにリンクする
You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit message (please note that the pull request must be on the default branch).
- close
- closes
- closed
- fix
- fixes
- fixed
- 解決
- resolves
- resolved
クローズするキーワードの構文は、Issueがプルリクエストと同じリポジトリにあるかどうかによって異なります。
| リンクするIssue | 構文 | サンプル |
|---|---|---|
| Issueが同じリポジトリにある | KEYWORD #ISSUE-NUMBER | Closes #10 |
| Issueが別のリポジトリにある | KEYWORD OWNER/REPOSITORY#ISSUE-NUMBER | Fixes octo-org/octo-repo#100 |
| 複数の Issue | Issueごとに完全な構文を使用 | Resolves #10, resolves #123, resolves octo-org/octo-repo#100 |
Only manually linked pull requests can be manually unlinked. キーワードを使用してリンクしたIssueのリンクを解除するには、プルリクエストの説明を編集してそのキーワードを削除する必要があります。
クローズするキーワードは、コミットメッセージでも使用できます。 The issue will be closed when you merge the commit into the default branch, but the pull request that contains the commit will not be listed as a linked pull request.