将github pull请求分支合并到本地分支

时间:2017-09-20 03:46:11

标签: git github

有没有办法将github pull请求分支合并到本地分支?

IE就好像

git clone https://github.com/tensorflow/tensorflow.git
git checkout -b work_in_progress
git merge https://github.com/tensorflow/tensorflow/pull/13107

2 个答案:

答案 0 :(得分:0)

转到您当地的分行并执行此操作。正如你已经在分支work_in_progress

git pull origin branch_name

如果您尚未提交任何内容,则可以运行

git fetch
git checkout branch_name // on which you want to work on

如果你没有主人以外的任何分支那么你做了什么, 即克隆后创建新分支将拥有所有数据。

答案 1 :(得分:0)

您正在寻找的是

git fetch origin pull/ID/head:BRANCHNAME

然后切换到新分支

[master] $ git checkout BRANCHNAME

然后您可以根据需要合并。这要归功于GitHub帮助 - https://help.github.com/articles/checking-out-pull-requests-locally/