![](/img/trans.png)
[英]How do I pull/cherry-pick a gerrit commit/patch to a branch using a http link to the commit?
[英]How do I cherry-pick an unmerged commit from github?
我想挑选这个补丁: https : //github.com/gioele/vim-autoswap/pull/17/commits/b9f49977bac269be90807dc27c9931517c84ff15
我已经克隆并尝试了存储库:
git cherry-pick b9f49977bac269be90807dc27c9931517c84ff15
得到:
fatal: bad object b9f49977bac269be90807dc27c9931517c84ff15
好,这是解决方案,从克隆的github存储库开始:
1)设置上游仓库(如果已经设置,请跳过此步骤)
git remote add upstream https://github.com/<gh_huser>/<gh_repo_name>.git
2)找到“拉取请求”编号。 如果是原始帖子,则为“ 17”。 在下一步中使用它。
3)获取拉取请求
git fetch upstream pull/<pull_request_number>/head:<new_branch_name>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.