需要从另一个存储库复制特定的Git提交

时间:2013-02-04 14:02:02

标签: git commit

我是git的新手

我需要获得此提交https://github.com/DJNoXD/candied-kernel/commit/3a9f10b82d9a5b6dc54ceab4d7edb60c5a7f19e6

到我的git https://github.com/nayak94/nayak-kernel/commits/0.1

我不知道该怎么做,任何帮助都会很棒

1 个答案:

答案 0 :(得分:4)

这应该可以解决问题:

git remote add candied-kernel git@github.com:DJNoXD/candied-kernel.git
git fetch candied-kernel master
git cherry-pick 3a9f10b

如果这是一次性的事情,您可能希望下载补丁文件,方法是将.patch附加到网址(即https://github.com/DJNoXD/candied-kernel/commit/3a9f10b82d9a5b6dc54ceab4d7edb60c5a7f19e6.patch),然后使用

git am /path/to/3a9f10b82d9a5b6dc54ceab4d7edb60c5a7f19e6.patch
相关问题