git - 如何从 pull 请求中克隆/下载代码

标签 git github

我在github上找到了源码。它有一些 pull 请求,指示更改代码。我想下载/克隆其中一个到我的电脑上。其 pull 请求 ID 为 3983,地址为 https://github.com/BVLC/caffe/pull/3983 谢谢大家

最佳答案

Because, someone has more one pull request, each pull request has own ID. How can I download correct version which corresponds to pull request ID

最好克隆原始仓库,然后导入 PR branch based on its ID

git clone https://github.com/BVLC/caffe
cd caffe
git remote add christianpayer https://github.com/christianpayer/caffe.git

然后,对于其中一个 christianpayer 的 merge PR 到 origin:

git fetch origin pull/3983/head:pull_3983
git checkout pull_3983

您可以从该远程仓库获取其他 PR,或添加其他远程仓库以获取其他 PR。

关于git - 如何从 pull 请求中克隆/下载代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42264017/

相关文章:

github - 在 github 中 fork 后作为组织 fork

windows - Heroku - 推送到 git 存储库时出现 fatal error

Git 状态显示文件已更改,即使内容相同

eclipse - 从 Eclipse 内部将本地 Git 存储库推送到远程 Google Cloud Repository?

python - 在 Github 提交中强制执行 PEP-8'ish 格式

Github:将上游分支导入fork

Git Hook - 在我推送到 github 后让服务器 pull

git - 有没有办法将 Git 提取分成多个较小的提取?

android - Github项目导入到Android Studio : Migrate Project to Gradle? 这个项目没有使用Gradle构建系统

android - .gitignore 不适用于 .cxx 文件夹