174

I'd like to reference commits in other repos (in this case submodules) in the github issues of my main repo. Is it possible to do so without typing the full hyperlink in a way similar to how github creates a shortened hyperlink from the commit number?

2

1 Answer 1

249

The answer, so us lazy people can find it without following the link to the Autolinked References and URLs section of the GitHub help:

User/Project@SHA

For example:

mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2

Short SHAs work as well (as long as they are unique):

mojombo/god@be6a8cc
6
  • 55
    For those looking to reference issues in other repos, it works as expected: user/repo#45.
    – J.D.
    Dec 26, 2013 at 16:49
  • 5
    And this is important: use the text of the reference as is. Do not wrap it into a markdown link, such as [xxx](mojombo/god@be6a8cc) Nov 11, 2015 at 14:44
  • 1
    doesn't work for me with googlemaps/android-maps-utils@3cba85f04a79095160015f62a8438eb76adbbe6f Dec 1, 2016 at 16:33
  • @J.D. : thanks so much, very helpful. Citation: help.github.com/articles/autolinked-references-and-urls
    – chharvey
    May 9, 2018 at 13:48
  • To link to a commit in an organization use the format: orgname/repo@SHA such as nodejs/node@90008f8.
    – gabrielf
    Mar 17, 2021 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.