Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 如何从特定repo下载源代码,其中只包含在该repo中的特定提交期间更改或添加的文件?_Git_Github - Fatal编程技术网

Git 如何从特定repo下载源代码,其中只包含在该repo中的特定提交期间更改或添加的文件?

Git 如何从特定repo下载源代码,其中只包含在该repo中的特定提交期间更改或添加的文件?,git,github,Git,Github,我正在处理一个项目,该项目引用了另一个用户的特定远程回购协议。最近的提交历史记录包含项目所需的文件。是否有任何方法可以下载此提交过程中添加的此类文件。将repo添加到您的遥控器中 git remote add anotherUser git://repo 获取更新 git fetch --all 然后使用 git cherry-pick sha-id-of-commit 将提交加载到当前分支

我正在处理一个项目,该项目引用了另一个用户的特定远程回购协议。最近的提交历史记录包含项目所需的文件。是否有任何方法可以下载此提交过程中添加的此类文件。

将repo添加到您的遥控器中

git remote add anotherUser git://repo
获取更新

git fetch --all
然后使用

git cherry-pick sha-id-of-commit
将提交加载到当前分支