如何在GitHub的问题评论中引用提交?

本文翻译自: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: 也可以看看:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值