本文翻译自: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 commit (using the #xxx notation). 我找到了很多关于如何在git提交中引用GitHub问题的答案(使用#xxx表示法)。 I'd like to reference a commit in my comment, generating a link to the commit details page? 我想在我的评论中引用提交,生成提交详细信息页面的链接?
#1楼
参考:https://stackoom.com/question/bNy3/如何在GitHub的问题评论中引用提交
#2楼
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). 可以在此处找到哈希(您可以单击它并从浏览器获取URL)。
Hope this saves you some time. 希望这能为您节省一些时间。
#3楼
To reference a commit, simply write its SHA-hash, and it'll automatically get turned into a link. 要引用提交,只需编写其SHA哈希,它将自动转换为链接。
See also: 也可以看看:
- The Autolinked references and URLs / Commit SHAs section of Writing on GitHub . 在GitHub上编写的Autolinked引用和URL / Commit SHA部分。