[英]Github pull request for a branch of a branch
My git log looks like this:我的 git 日志如下所示:
-------> develop
\---> A
\---> B
Branch A is based off of develop, and is being reviewed in a pull request.分支 A 基于开发,正在拉取请求中进行审查。 In the meantime, I need to develop more stuff off of the branch, so I create Branch B. There is also a pull request for Branch B into develop, which includes the commits for both Branch A and Branch B.
与此同时,我需要在分支之外开发更多东西,所以我创建了分支 B。还有一个分支 B 的拉取请求到开发中,其中包括分支 A 和分支 B 的提交。
The review of branch A finishes, and it is merged into develop, at which point, Github says that I need to merge develop into branch B, but if I do this, then usually it generates a lot of merge conflicts and can be difficult to untangle. branch A的review结束,合并到develop,这时Github说我要合并develop到branch B,但是如果我这样做,那么通常会产生很多合并冲突,很难解开。
Is there a way to do pull requests for both Branch A and B simultaneously, without Branch B's pull request getting confused when Branch A merges in?有没有办法同时对分支 A 和 B 进行拉取请求,而不会在分支 A 合并时混淆分支 B 的拉取请求?
I see a problem with the workflow here. 我在这里看到工作流程有问题。 Why are you merging a branch into something other than the branch it was created off?
为什么将分支合并到分支创建以外的其他内容中?
Changing the workflow like this can get everything working smoothly: 像这样更改工作流程可以使所有工作顺利进行:
One solution may be to use the Github feature that allows you to change the base branch of a pull request . 一种解决方案是使用Github功能,该功能允许您更改拉取请求的基础分支 。 So the workflow looks like this:
因此,工作流程如下所示:
Once you change Branch B's base, then I think Github should show the proper diffs, but haven't tested this yet. 一旦更改了B分支的基准,我认为Github应该显示适当的差异,但尚未对此进行测试。
Github says that I need to merge develop into branch B, but if I do this, then usually it generates a lot of merge conflicts and can be difficult to untangle.
Github 说我需要将 develop 合并到分支 B,但是如果我这样做,通常会产生很多合并冲突并且很难解决。
Instead of a merge, rebasing B on top of develop could be less conflict-prone, if the change in refs isn't otherwise a problem for you.如果 refs 的更改对您来说不是问题,那么在 develop 之上重新设置 B 而不是合并,可能不会那么容易发生冲突。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.