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?
Asked
Active
Viewed 3.7k times
169
-
https://help.github.com/articles/autolinked-references-and-urls/ – chharvey May 09 '18 at 13:49
-
See also [Link to the issue number on GitHub within a commit message](https://stackoverflow.com/questions/1687262/link-to-the-issue-number-on-github-within-a-commit-message) – Didier L May 28 '18 at 16:23
1 Answers
243
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

c32hedge
- 785
- 10
- 19

Martin Vilcans
- 5,428
- 5
- 22
- 17
-
54For those looking to reference _issues_ in other repos, it works as expected: `user/repo#45`. – J.D. Dec 26 '13 at 16:49
-
5And 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)` – Pierre Arnaud Nov 11 '15 at 14:44
-
1doesn't work for me with googlemaps/android-maps-utils@3cba85f04a79095160015f62a8438eb76adbbe6f – Alex Sorokoletov Dec 01 '16 at 16:33
-
@J.D. : thanks so much, very helpful. Citation: https://help.github.com/articles/autolinked-references-and-urls/ – chharvey May 09 '18 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 '21 at 21:05
-