Do you avoid linking issues to PRs in GitHub?
Last updated by Brady Stroud [SSW] 11 months ago.See historyGitHub provides a way to link issues to PRs. This is useful to see what PRs are associated with what issues. However, when you make this link, the issue will close when the PR is merged.
This is not a good idea because it can cause Issues to be closed prematurely. This can lead to confusion and lost work.
Luckily, GitHub provides a way to avoid this auto-closing behavior by disabling it in the repository settings.
Issues should not be closed until all the tasks are complete and have a done comment as per closing PBIs with context.
Disabling auto-close at the repository level
If your team prefers to keep the linking functionality but disable the auto-close behavior, repository administrators can now turn this off in the repository settings:
- Go to Settings | General
- Scroll down to the Issues section
- Deselect Auto-close issues with merged linked pull requests
See Managing the automatic closing of issues in your repository for more details.

