如何从存储库下载特定的git提交? [英] How do I download a specific git commit from a repository?

查看:144
本文介绍了如何从存储库下载特定的git提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有本地代码副本/ etc,我只想下载一个特定的git提交,以便我可以查看它。我有git仓库的URL:



git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git

和提交哈希值:

  ee9c5cfad29c8a13199962614b9b16f1c4137ac9 

如何使用git下载这个提交(我不希望整个repo,只有一个提交补丁)?我已经阅读了git-pull和git-cherry-pick的man页面,并且没有运气就用命令弄乱了。



克隆回购确实不是一种选择,因为一些内核存储库非常大,而且下载速度很慢(小时)。

解决方案

这似乎是不可能的。根据如何使用指定的提交id ?\">拉远程分支讨论在kernel.org上,该协议将只允许获取命名参考。如果您不希望从git网站下载快照,则必须克隆整个repo。



(您可能希望阅读< a href =http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html =noreferrer> git-fetch 和 git-ls-remote 。)


I don't have a local code copy/etc, I just want to download a single specific git commit so I can view it. I have the url for the git repository:

git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git

and the commit hash:

ee9c5cfad29c8a13199962614b9b16f1c4137ac9

How can I download just this commit using git (I don't want the whole repo, just the one commit patch)? I have read the man pages for git-pull and git-cherry-pick and fiddled with the commands with no luck.

Cloning the repo really isn't an option because some of the Kernel repositories are exceedingly large and slow to download (hours).

解决方案

This would appear to be impossible. According to a discussion on kernel.org, the protocol will only allow named refs to be fetched. If you don't wish to download the snapshot from the git website, you'll have to clone the entire repo.

(You may wish to read the manuals for git-fetch and git-ls-remote.)

这篇关于如何从存储库下载特定的git提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆