如何在GitHub上修改拉取请求以更改要合并到的目标分支? [英] How to modify a pull request on GitHub to change target branch to merge into?

查看:250
本文介绍了如何在GitHub上修改拉取请求以更改要合并到的目标分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个拉取请求,请求从我的分支合并到master,但是所有者希望我将请求更改为合并到与我的分支不同的分支.

I have a pull request that is requesting a merge into master from my branch, but the owner wants me to change the request to merge into a different branch from my branch.

这可能吗?有什么可能的解决方案?

Is this possible? What are the possible solutions?

推荐答案

2016年8月更新: 最终允许更改该分支.
(这会关闭
issue 18 ,它已经3岁了,有1500多个评论)

Update August 2016: Change the base branch of a Pull Request finally allows for changing that branch.
(And this closes issue 18, which was 3 years old and had 1500+ comments)

创建请求请求后,您可以修改基础分支,以便将请求请求中的更改与其他分支进行比较.

After you’ve created a pull request, you can modify the base branch so that the changes in the pull request are compared against a different branch.

原始答案:

由于无法在分支机构中编辑PR(请参见下文),所以最简单的方法是:

Since a PR cannot be edited in term of branch (see below), the easiest way would be to:

  • 在当前分支的顶部创建一个本地新分支
  • 推动那个新分支
  • 使用正确的目的地进行新的PR.
  • 关闭先前的PR
  • 引用新请求中的旧"请求请求;例如. Supersedes #123(如下里维拉所述)
  • create a local new branch on top of your current branch
  • push that new branch
  • make a new PR with the right destination.
  • close the previous PR
  • reference the "old" pull request from the new one; eg. Supersedes #123 (as commented below by Rivera)

(原始答案,仅在创建PR 时有效)

(original answer, valid only when creating the PR)

您可以尝试选择另一个基本分支,如"Edit按钮)

You could try and chose another base branch, as in "Changing the branch range and destination repository" (Clicking on the Edit button at the top of a PR page)

思考分支范围的最简单方法是:

The easiest way of thinking about the branch range is this:

  • 基本分支是您认为应应用更改的位置,
  • 头分支是您要应用的内容.
  • the base branch is where you think changes should be applied,
  • the head branch is what you would like to be applied.

更改基础存储库将更改通知拉动请求的人.
能够推送到基础存储库的每个人都将收到一封电子邮件通知,并在下次登录时在其仪表板中看到新的请求请求.

Changing the base repository changes who is notified of the pull request.
Everyone that can push to the base repository will receive an email notification and see the new pull request in their dashboard the next time they sign in.

如果选择原始维护者(所有者)想要的作为基础分支,则您的PR应该从您的分支(不变)合并到新的基础分支.

If you select as a base branch the one that the original maintainer (the owner) wants, your PR should merge from your branch (unchanged) to the new base branch.

这篇关于如何在GitHub上修改拉取请求以更改要合并到的目标分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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