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 using a supported keyword in the pull request description.
プルリクエストが対処するIssueにそのプルリクエストにリンクすると、コラボレータは、誰かがそのIssueに取り組んでいることを確認できます。 If the pull request and the issue are in different repositories, GitHub Enterprise will display the link after the pull request is merged, if the person who merges the pull request also has permission to close the issue.
リンクされたプルリクエストをリポジトリのデフォルトブランチにマージすると、それにリンクされているIssueは自動的にクローズされます。 For more information about the default branch, see "Changing the default branch."
キーワードを使用してプルリクエストを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 |
クローズするキーワードは、コミットメッセージでも使用できます。 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.