Tomáš Zato Tomáš Zato - 1 year ago 114
Git Question

In source tree, which is "mine" and which is "theirs" in merge diff?

I'm merging two branches. I assume I'm on HEAD branch right now. When I only want to pick one branche's version of the file. The one I want to pick depends on the contents, not on the branch.

For example on the image below I want to pick the second line:

In source

But from which line does the second line come? I do not really understand the output of the program here.

Answer Source

The branch names are right there next to the conflict markers. The one you used with your last checkout is "ours", the one you mentioned in the git merge command is theirs.

In fact, I cannot do better than to quote 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.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download