是否可以继续其他人在 Github 上打开的拉取请求?
Is it possible to continue a pull request opened by someone else on Github?
在一个不是我的仓库中,第三个人打开了一个拉取请求。其中一位所有者建议在合并之前进行一些更改。但是pull request的作者并没有做,一直开着好几个月都没有实现修改。
其实我指的是一种情况like this one。
我会根据要求对 myslef 进行改进。
最干净、最好的方法是什么?我可以在下面添加我的提交还是需要打开一个新的拉取请求?
从你的分支使用这个命令
git pull origin <the open pull request branch name>
它将提交从那个分支拉到你的分支。
进行改进并将其推送到主分支。
更新 拉取请求的唯一方法是推送到已被 PR 的分支 - 因此默认情况下,即使是原始 repo 的所有者也无法修改 PR。它 确实 有意义 - 至少为了可追溯性。
所以如果你想完成这项工作,你能做的最好的事情就是在你的机器上 fork 原始 repo,clone
,添加 PR 的 repo 作为 remote
,checkout
PR 的分支,commit
最重要的是,push
对你自己的分支所做的更改,并在评论中创建一个新的 PR,说明它继续并修复了另一个 PR,所以当你的合并时,原始 PR 将关闭。
在这种情况下,类似于:
$ # Go to https://github.com/cheeriojs/cheerio/ and fork it
$ git clone https://github.com/Delgan/cheerio/ && cd cheerio # assuming that's your GH username :)
$ git remote add pr-base https://github.com/digihaven/cheerio/
$ git fetch pr-base
$ git checkout pr-base/master -b 641-appendTo_prependTo
$ # work work work
$ git add #...
$ git commit -m 'Fixed all the things! See #641, fixes #726'
$ git push origin 641-appendTo_prependTo
$ # Go to your repo and make the PR
$ # ...
$ # SUCESS! (??!)
在一个不是我的仓库中,第三个人打开了一个拉取请求。其中一位所有者建议在合并之前进行一些更改。但是pull request的作者并没有做,一直开着好几个月都没有实现修改。
其实我指的是一种情况like this one。
我会根据要求对 myslef 进行改进。
最干净、最好的方法是什么?我可以在下面添加我的提交还是需要打开一个新的拉取请求?
从你的分支使用这个命令
git pull origin <the open pull request branch name>
它将提交从那个分支拉到你的分支。
进行改进并将其推送到主分支。
更新 拉取请求的唯一方法是推送到已被 PR 的分支 - 因此默认情况下,即使是原始 repo 的所有者也无法修改 PR。它 确实 有意义 - 至少为了可追溯性。
所以如果你想完成这项工作,你能做的最好的事情就是在你的机器上 fork 原始 repo,clone
,添加 PR 的 repo 作为 remote
,checkout
PR 的分支,commit
最重要的是,push
对你自己的分支所做的更改,并在评论中创建一个新的 PR,说明它继续并修复了另一个 PR,所以当你的合并时,原始 PR 将关闭。
在这种情况下,类似于:
$ # Go to https://github.com/cheeriojs/cheerio/ and fork it
$ git clone https://github.com/Delgan/cheerio/ && cd cheerio # assuming that's your GH username :)
$ git remote add pr-base https://github.com/digihaven/cheerio/
$ git fetch pr-base
$ git checkout pr-base/master -b 641-appendTo_prependTo
$ # work work work
$ git add #...
$ git commit -m 'Fixed all the things! See #641, fixes #726'
$ git push origin 641-appendTo_prependTo
$ # Go to your repo and make the PR
$ # ...
$ # SUCESS! (??!)