Git - diff3 Conflict Style - Temporary merge branch

前端 未结 1 1758
暖寄归人
暖寄归人 2020-12-09 16:19

I am doing a merge with merge.conflictStyle set to diff3. Normally, this inserts three (3) sections separated by four (4) sets of characters.

相关标签:
1条回答
  • 2020-12-09 16:44

    What you have here (with the Temporary merge branch 1 and same with 2) is due to git's "recursive merge" method:

                o->branch1 = "Temporary merge branch 1";
                o->branch2 = "Temporary merge branch 2";
                merge_recursive(o, merged_common_ancestors, iter->item,
                                NULL, &merged_common_ancestors);
    

    (merge-recursive.c, around line 1940). Git will do a recursive merge when the commit graph has multiple candidates for the merge-base (see this blog post for more). To (over?)simplify a bit, git has done an internal, recursive merge that produced a merge conflict, then done the outer merge and hit another merge conflict. What you see is the outer merge conflict (ours vs theirs) with the inner conflict shown as the "base" version.

    You may find that you get better results by choosing some other merge strategy, or using an alternative diff algorithm (the patience, minimal, and histogram algorithms vs the default myers). Or, you might want to disable diff3 style for a bit, so that you simply don't see the inner merge.

    0 讨论(0)
提交回复
热议问题