【发布时间】:2019-12-03 16:23:18
【问题描述】:
我知道我可以使用git merge ref1 ref2 触发章鱼合并,但是否也可以使用多个命令获得相同的结果,例如
git merge --no-commit ref1
git merge --no-commit --magic-option ref2
git commit
或之后
git merge ref1
git merge ref2
将最后 2 个合并提交变成 1 个章鱼合并提交?
【问题讨论】:
-
请注意,
git merge-octopus使用不同的合并基础计算并拒绝执行需要解决冲突的合并,因此无论您如何执行此操作,都不一定会得到 使用带有多个哈希或分支名称的git merge或git merge -s octopus的结果。但大多数情况下,请参阅eftshift0's answer。