Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reference a commit in an issue comment on GitHub?

I find a lot of answers on how to reference a GitHub issue in a git comment (using the #xxx notation). I'd like to reference a commit in my comment, generating a link to the commit details page?

like image 779
LodeRunner Avatar asked Jan 18 '12 12:01

LodeRunner


People also ask

How do you reference a comment on GitHub?

You can now quote comments in issues and pull requests by choosing Quote reply from the comment's options menu. This will paste quoted contents of the comment into the text field for the new comment. If part of a comment is selected, only that selection will be quoted.


2 Answers

To reference a commit, simply write its SHA-hash, and it'll automatically get turned into a link.

See also:

  • The Autolinked references and URLs / Commit SHAs section of Writing on GitHub.
like image 105
Sebastian Paaske Tørholm Avatar answered Dec 10 '22 11:12

Sebastian Paaske Tørholm


Answer above is missing an example which might not be obvious (it wasn't to me).

Url could be broken down into parts

https://github.com/liufa/Tuplinator/commit/f36e3c5b3aba23a6c9cf7c01e7485028a23c3811                   \_____/\________/       \_______________________________________/                    |        |                              |             Account name    |                      Hash of revision                         Project name               

Hash can be found here (you can click it and will get the url from browser).

enter image description here

Hope this saves you some time.

like image 36
Matas Vaitkevicius Avatar answered Dec 10 '22 11:12

Matas Vaitkevicius