我合并了两个分支。我现在假设我正在 HEAD 分支上。当我只想选择一个分支版本的文件时。我想选择的那个取决于内容,而不是分支。
例如,在下图中我想选择第二行:
但第二行来自哪条线?我真的不明白这个程序的输出。
答案 0 :(得分:1)
分支名称就在冲突标记旁边。您上次结账时使用的那个是“我们的”,您在git merge
命令中提到的那个是他们的。
事实上,我做的不仅仅是引用git help merge
:
By default, Git uses the same style as the one used by the "merge" program from the RCS suite to present such a
conflicted hunk, like this:
Here are lines that are either unchanged from the common
ancestor, or cleanly resolved because only one side changed.
<<<<<<< yours:sample.txt
Conflict resolution is hard;
let´s go shopping.
=======
Git makes conflict resolution easy.
>>>>>>> theirs:sample.txt
And here is another line that is cleanly resolved or unmodified.
The area where a pair of conflicting changes happened is marked with markers <<<<<<<, =======, and >>>>>>>. The part
before the ======= is typically your side, and the part afterwards is typically their side.
答案 1 :(得分:0)
我对 Sourcetree(4.1.0,2021 年 3 月 24 日)做了一个小测试,至少阐明了这个用例
branch mineA, text "a"
branch mineB, text "b"
current branch: mineB
merge mineA into mineB
resolve conflict using 'mine'
text: "b"