GitHub 将请求拉到一个新的上游分支

我的工作流程: 我有一个远程项目的分支(原点)(上游)。我已经创建了一个分支,主题/票。我想创建一个拉请求,我的起源分支的上游项目在同名,全新的“主题/TICKET”分支。换句话说,我不希望将请求拉向主分支或任何现有分支。

当使用 BitBucket 时,我有这个选项。当我创建我的 PR 时,我选择我的原始分支,然后远程分支选择允许“创建新分支(主题/TICKET)”。

在 GitHub 中,我似乎没有这个选项。我可以输入新的分支名称,但是选项继续使用灰色,直到我选择一个有效的、现有的上游分支。

烦人的解决方法是在我执行 PR 之前创建上游的分支; 但是它需要询问能够提交上游的人——在我看来,必须有一种更简单的方法来做到这一点。

那么,GitHub 是否有办法创建一个拉请求来创建一个新的上游分支,或者这只是一个已知的限制?

25488 次浏览

I don't think you can do that on Github. And also think is okay like that, because you shouldn't be able to "create" a new branch on a project you don't necessarily have push access. Even if you do have push access to the upstream project i don't see it as a clean workflow.

I was trying a similar thing, and the only solution I got is to have an user with push permission to upstream.

That way you could do a first push to upstream. Right after that, you also do a push to origin; and afterwards you can make your pull requests from branch to branch as you wish in first place.

Just be careful when you create the pull request, because the default selected branch for upstream is always "master"