使用GitHub Api从上游合并
看起来我无法使用github api合并来自上游回购的提交:使用GitHub Api从上游合并,github,Github,看起来我无法使用github api合并来自上游回购的提交: 我希望base参数是其他人的fork的分支。我试着用base作为“otheruser/master”和“otheruser:master”进行发布。在这个端点上没有办法跨分支合并吗?据我所知,mergeapi只支持在同一存储库中合并分支 我想你想提出拉车请求。 必须在存储库中/从中发出请求,更改将被拉入。在您的例子中,端点看起来像这样 /repos/:owner/:repo/pulls :所有者将是其他用户 :repo将是他们分支
我希望
base
参数是其他人的fork的分支。我试着用base作为“otheruser/master
”和“otheruser:master
”进行发布。在这个端点上没有办法跨分支合并吗?据我所知,mergeapi只支持在同一存储库中合并分支
我想你想提出拉车请求。必须在
存储库中/从中发出请求,更改将被拉入。在您的例子中,端点看起来像这样
/repos/:owner/:repo/pulls
:所有者将是其他用户
:repo
将是他们分支的名称
如文档中所述,这是一篇POST
。在正文中,您可以将分支指定为头
,如下所示:
。base
应该只是分支的名称。base
只需要是分支的名称,因为拉取请求是在具有base
分支的存储库中发出的。解决方案是使用refs
请求如下所示:
https://api.github.com/repos/<fork-owner>/<fork-repo>/git/refs/heads/<forked-branch-name>
{
"sha": <master-sha-in-origin-repo>,
"force": true
}
https://api.github.com/repos///git/refs/heads/
身体看起来像这样:
https://api.github.com/repos/<fork-owner>/<fork-repo>/git/refs/heads/<forked-branch-name>
{
"sha": <master-sha-in-origin-repo>,
"force": true
}
{
“sha”:,
“力量”:真实
}
小心
如果在fork和原始文件之间有一个Pull请求打开,它将关闭PR并运行提交在这种情况下,生成PR如何帮助我?从fork到我的repo存在一个PR-aleady,我想使用GithubApi用master更新fork的代码库