[英]Retrieve latest git commit hash of a Github repository without cloning
Is it possible to remotely retrieve the latest commit hash of a Github repo without cloning it locally? 是否可以远程检索Github存储库的最新提交哈希,而无需在本地克隆它? I'm referring to something like the following you see at the top of all the repos in Github:
我指的是类似下面在Github中所有回购顶部看到的内容:
Based on some older questions it seems that this may not be possible with git
directly (unless there's a new feature that enables it), so the right answer might involve using the Github API (turns out Github API won't work for my use case since I'll have to use a different set of credentials then the private key git
uses). 基于一些较旧的问题 ,似乎直接使用
git
可能无法实现(除非有启用它的新功能), 因此正确的答案可能涉及使用Github API (事实证明Github API在我的用例中不起作用)因为我必须使用一组不同的凭据,然后才使用私钥git
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.