如何将来自其他分叉的未合并的上游拉取请求应用到我的分叉中? [英] How to apply unmerged upstream pull requests from other forks into my fork?

查看:20
本文介绍了如何将来自其他分叉的未合并的上游拉取请求应用到我的分叉中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 GitHub 上有一个分支的项目有一个新的拉取请求,我想拉到我的叉中,但作者尚未拉入.

A project on GitHub that I have a fork of has a new pull requests that I want to pull into my fork that the author has not pulled in yet.

是否有一种简单的方法可以将来自其他分叉的拉取请求应用到我的分叉中?这里还有什么我遗漏的吗?

Is there a simple way to apply pull request from other forks into my fork? Is there something else here that I am missing?

推荐答案

你可以很容易地手动完成:

You can do it manually quite easily:

  • 添加另一个 fork 作为你的 repo 的远程:

  • add the other fork as a remote of your repo:

git remote add otherfork git://github.com/request-author/project.git

  • 获取他的 repo 的提交

  • fetch his repo's commits

    git fetch otherfork
    

  • 然后您有两个选项来应用拉取请求(如果您不想选择选择 1.)

  • You have then two options to apply the pull request (if you don't want to choose pick 1.)

    1. 如果您不关心应用已在源和拉取请求之间添加的最终提交,您可以重新建立拉取请求所在的分支

    1. If you don't care about applying also the eventual commits that have been added between the origin and the pull request, you can just rebase the branch on which the pull request was formed

    git rebase master otherfork/pullrequest-branch
    

  • 如果您只想要拉取请求中的提交,请确定它们的 SHA1 并执行

  • If you only want the commits in the pull request, identify their SHA1 and do

    git cherry-pick <first-SHA1> <second-SHA1> <etc.>
    

  • 这篇关于如何将来自其他分叉的未合并的上游拉取请求应用到我的分叉中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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