[英]Merging remote branches in git
I am developing a system where I'm following the trails of another project, adding my own stuff but not directly to the original project. 我正在开发一个系统,我正在跟踪另一个项目的路径,添加我自己的东西,但不是直接到原始项目。 I setup my repository with three remote branches:
我用三个远程分支设置我的存储库:
My workflow idea is for the synchronization to take place automatically (since it's basically a fast-forward of sorts), and the integration to be half-manual (since it requires merges and fixes). 我的工作流程理念是自动进行同步(因为它基本上是各种快速的),并且集成是半手动的(因为它需要合并和修复)。 I've got the first part (the sync) covered, but I can't figure out what command/s to actually issue to integrate Master and Vendor into integration.
我已经介绍了第一部分(同步),但我无法弄清楚将Master和Vendor集成到集成中的实际问题。
This is the output of git branch -a : 这是git branch -a的输出:
* integration
master
vendor
remotes/origin/HEAD -> origin/master
remotes/origin/integration
remotes/origin/master
remotes/origin/vendor
How do I go forward from this point to: 我如何从这一点前进到:
And obviously, if I have something wrong in the workflow I'd love to hear it. 显然,如果我在工作流程中出现问题,我很乐意听到它。
While the integration
branch is not strictly necessary (you could integrate directly vendor
into master
, by rebasing master
on top of vendor
), it can be useful. 虽然
integration
分支并不是绝对必要的(您可以直接将vendor
集成到master
,通过在vendor
之上重新设置master
),但它可能很有用。
Integrating a branch A
in a branch B
can be done by: 在分支
B
集成分支A
可以通过以下方式完成:
A
in B
(but that means any current development you have in B
is "on hold" pending the resolutions of any merge conflict, and the re-runs of all the tests) B
合并A
(但这意味着您在B
任何当前开发都处于“暂停”状态,等待任何合并冲突的解决方案,并重新运行所有测试) B
on top of A
( git rebase A
), but that would change B
's history. A
( git rebase A
)之上重新定位B
,但这会改变B
的历史。 I would rebase integration
on top of Vendor
, solving any conflict there, and then merge integration
in master
, keeping master
history linear. 我会在
Vendor
之上重新integration
,解决那里的任何冲突,然后在master
合并integration
,保持master
历史的线性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.