如何在拉取请求合并后更新拉取请求网站? [英] How to update pull-requesting site after pull request has been merged?

查看:117
本文介绍了如何在拉取请求合并后更新拉取请求网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设GitHub repo B 向GitHub repo A 发送一个pull请求,并假设pull获得因此,为了接受由 B 提出的修改, , A 的所有者从离线存储库中提取请求,执行合并,并将合并推送到 A 。现在 A 至少有一个提交在 B 之前。



B 现在如何自动更新为与 A 同步?这可以完全从GitHub的网页界面完成吗?



(我想第一个问题的答案是, B 可以取得 A 回购的内容,然后将结果状态推至 B repo,但我想知道是否有办法直接从GitHub Web界面更新 B repo。)

解决方案

据我所知,使用GitHub的Web界面实现这一目标的唯一方法是创建一个反向拉取请求。然而,这是以额外的合并提交为代价的,因为它总结了新的合并提交,并且从 B A 将包含所有那些不必要的提交。



可能使用Git DataAPI 来合并一些分支,但在命令行上更简单和安全。



< hr>

我推荐给其他人的策略是这样的:


  1. 永远不要修改您的 master 或任何主线分支被调用

  2. 将您的pull请求分支基于您的 master
  3. 每当上游 master 发生变化时,通过快速转发您的 master 到上游。

这样,您的拉动请求将保持良好和干净,您不会遇到任何问题拒绝承诺弹出我n后续的拉取请求。

Let's say that GitHub repo B sends a pull request to GitHub repo A, and suppose that the pull won't go through without resolving some conflicts and merging.

Therefore, in order to accept the changes proposed by B, the owner of A makes the pull request from an offline repo, performs the merge, and pushes the merge to A. Now A is at least one commit ahead of B.

How does B now update itself to be in sync with A? Can this be done entirely from within the GitHub web interface?

(I imagine that one answer to the first question would be that the owner of B could pull the contents of the A repo, and then push the resulting state to the B repo, but I was wondering if there's a way to update the B repo directly from the GitHub web interface.)

解决方案

As far as I know the only way to achieve this using GitHub's web interface is creating a reverse pull request. This however comes at the cost of an additional merge commit which is usually not desirable as it sums up and new pull requests from B to A will include all those unneccesary commits.

It probably is possible to use the „Git Data" API to merge some branches, but it is easier and safer to do it on the command line.


The strategy I recommend to others is this one:

  1. Never ever modify your master or whatever the mainline branch is called
  2. Base your pull request branches on your master
  3. Whenever there are changes to the upstream master integrate them by fast forwarding your master to the upstream one.

That way your pull requests will stay nice and clean and you won't have issues with rejected commits popping up in subsequent pull requests.

这篇关于如何在拉取请求合并后更新拉取请求网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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