GitHub: closing issues via commit messages

If anyone missed it (like I did), it’s worth noting due to my ultimate laziness:

When you enter “Fixes #45” into a commit message, issue #45 is closed once that commit is merged into your default branch. If the bug isn’t fixed in your default branch, the issue remains open. Once the commit with the fix is merged into your default branch, the issue is automatically closed.

If you make a commit in a non-default branch with the “Fixes #33” syntax, the issue is referenced with a tooltip.

You can use any of the following keywords to close an issue via commit message:

  • close
  • closes
  • closed
  • fixes
  • fixed
  • resolve
  • resolves
  • resolved

Leave a Reply