Link to the issue number on GitHub within a commit message

Mika Tuupola picture Mika Tuupola · Nov 6, 2009 · Viewed 990.9k times · Source

Is it somehow possible to automatically have a link to GitHub issue number in the git commit message?

Answer

NARKOZ picture NARKOZ · Jul 19, 2011

Just include #xxx in your commit message to reference an issue without closing it.

With new GitHub issues 2.0 you can use these synonyms to reference an issue and close it (in your commit message):

  • fix #xxx
  • fixes #xxx
  • fixed #xxx
  • close #xxx
  • closes #xxx
  • closed #xxx
  • resolve #xxx
  • resolves #xxx
  • resolved #xxx

You can also substitute #xxx with gh-xxx.

Referencing and closing issues across repos also works:

fixes user/repo#xxx

Check out the documentation available in their Help section.