How do I merge multiple branches into master?
1 2 3 4 5 6 7 8 9 | C---D =>b1 / / E---F =>b2 | / A--B =======> master | \ \ G---H =>b3 \ I---J =>b4 |
我想把
比如:
1 2 | git checkout master git merge b1 b2 b3 b4 |
号
git的
另请参阅此问题,了解对每个问题的不太正式的描述。
章鱼This resolves cases with more than two
heads, but refuses to do a complex merge that needs manual resolution.
It is primarily meant to be used for bundling topic branch heads
together. This is the default merge strategy when pulling or merging
more than one branch.
号
最后一句话意味着,如果你使用
This resolves any number of heads, but the resulting tree of the merge is always that of the current branch head, effectively ignoring
all changes from all other branches. It is meant to be used to
supersede old development history of side branches.
号
有关用例示例,请参见此问题。
Git有一个名为Octupus的合并策略,它可以合并多个分支,只要不存在复杂的冲突。执行此操作的命令与您建议的