How do you link a pull request to an issue so that it closes automatically?
Write a closing keyword such as Closes
Explain it simply
It is like stapling the tracking slip to a delivery: when the parcel arrives, the ticket is ticked off.
Keywords include close, closes, closed, fix, fixes, fixed, resolve, resolves and resolved, followed by #number. They work in the PR description and in commit messages, and the issue closes when the PR is merged into the default branch, not before. For other repos use owner/repo#42. The sidebar's Development section can also link manually.
Example
Pull request description:
Add rupee formatting to the cart total.
Closes #42What to say in the interview
"I add a keyword like Closes #42 to the PR description or commit message. When the PR is merged into the default branch, GitHub automatically closes the issue, and the two stay linked."