如何在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: 也可以看看:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提交代码到GitHub有多种方法。其一种方法是使用命令行工具Git进行提交。首先,你需要在GitHub上创建一个仓库,并获取仓库的URL。然后,你可以使用以下命令将代码提交GitHub: 1. 首先,在本地创建一个文件夹,并在该文件夹初始化Git仓库: ``` git init ``` 2. 将你的代码复制到该文件夹。 3. 使用以下命令将所有文件添加到Git仓库: ``` git add . ``` 4. 使用以下命令提交你的代码,并添加一条注释: ``` git commit -m "提交代码" ``` 5. 使用以下命令将本地仓库与GitHub仓库关联起来: ``` git remote add origin <GitHub仓库URL> ``` 6. 最后,使用以下命令将代码推送到GitHub仓库: ``` git push -u origin master ``` 这样,你的代码就会被提交GitHub仓库了。请注意,如果是第一次提交代码,可能需要输入你的GitHub用户名和密码。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [如何将代码上传到Github](https://blog.csdn.net/qq_33639213/article/details/102719505)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [代码提交Github的3种方法](https://blog.csdn.net/xu_song/article/details/94734095)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值