如何将git imerge最终结果合并到目标分支?

时间:2017-08-02 08:19:44

标签: git merge git-merge merge-conflict-resolution

我使用git-imerge合并两个分支。

git checkout branchA
git-imerge start --name=merge-devolp-to-A--first-parent --goal=rebase-with-history develop

我运行上面的命令,将develop分支合并到branchA。

合并完成后,git-imerge将最终结果放到一个独立的HEAD中,然后将HEAD放到一个新的分支上。

git branch merged ca9d786

enter image description here

这些提交使整个跟踪看起来很乱,我不认为谁能理解什么是合并x-x。

那么我该怎么做呢,把真正的最终合并结果放到开发分支或branchA只有一个提交好消息的提交?

日志 -

$ git-imerge start --name=merge-dev-to-branchA --first-parent --goal=rebase-with-history develop
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9302/9302), done.
Checking out files: 100% (9272/9272), done.
Checking out files: 100% (9643/9643), done.

Attempting automerge of 7-11...failure.
Attempting automerge of 1-1...success.
Attempting automerge of 1-7...success.
Attempting automerge of 1-10...success.
Attempting automerge of 1-11...success.
Attempting automerge of 7-11...failure.
Attempting automerge of 4-11...failure.
Attempting automerge of 3-11...failure.
Attempting automerge of 2-11...failure.
Attempting automerge of 2-1...success.
Attempting automerge of 2-6...failure.
Attempting automerge of 2-4...failure.
Attempting automerge of 2-3...success.
Attempting automerge of 7-3...success.
Autofilling 1-1...success.
Autofilling 1-2...success.
Autofilling 1-3...success.
Autofilling 1-4...success.
Autofilling 1-5...success.
Autofilling 1-6...success.
Autofilling 1-7...success.
Autofilling 1-8...success.
Autofilling 1-9...success.
Autofilling 1-10...success.
Autofilling 1-11...success.
Recording autofilled block MergeState('merge-dev-to-branchA', tip1='feature/branchA', tip2='develop', goal='rebase-with-history')[0:2,0:12].
Autofilling 2-3...success.
Autofilling 3-3...success.
Autofilling 4-3...success.
Autofilling 5-3...success.
Autofilling 6-3...success.
Autofilling 7-1...success.
Autofilling 7-2...success.
Autofilling 7-3 (first way)...success.
Autofilling 7-3 (second way)...success.
The two ways of autofilling 7-3 agree.
Recording autofilled block MergeState('merge-dev-to-branchA', tip1='feature/branchA', tip2='develop', goal='rebase-with-history')[1:8,0:4].
Attempting automerge of 7-11...success.
Autofilling 2-11...success.
Autofilling 3-11...success.
Autofilling 4-11...success.
Autofilling 5-11...success.
Autofilling 6-11...success.
Autofilling 7-4...success.
Autofilling 7-5...success.
Autofilling 7-6...success.
Autofilling 7-7...success.
Autofilling 7-8...success.
Autofilling 7-9...success.
Autofilling 7-10...success.
Autofilling 7-11 (first way)...success.
Autofilling 7-11 (second way)...success.
The two ways of autofilling 7-11 agree.
Recording autofilled block MergeState('merge-dev-to-branchA', tip1='feature/branchA', tip2='develop', goal='rebase-with-history')[1:8,3:12].
Merge is complete!

1 个答案:

答案 0 :(得分:1)

如果您希望将简单合并作为最终结果,则应设置--goal=merge

git-imerge start --name=merge-develop-to-A --first-parent --goal=merge develop

或者更简单地说,

git-imerge merge develop

然后,当imerge完成并且您对结果感到满意时,输入

非常重要
git-imerge finish

,它清理中间合并并将原始分支设置为指向结果。