I used to do conflict resolution with P4merge. I found it OK but I didn't pay any attention to how it does the job under the hood. Until very recently I realized that it tries to make the merge by itself. As a result it doesn't show the same conflicts as git does and that frustrated my manager (like in let's switch back to clearcase
frustrated).
The question is: git adds annotations to a file that can't merge similar to these
<<<<<<< HEAD
this code
=======
the other code
>>>>>>> feature/branch-name
Is there a graphical tool that reads these annotations and then gives you the option to keep the one or the other and then remove the annotations?
The tool should be for Linux and preferably free but since the organization will take care of the cost, it can be paid as well.
UPDATE: kdiff3 trial
Unfortunately kdiff3
doesn't respect annotations either. First of all the setup didn't work but no big deal, I've changed the .gitconfig
to
[mergetool "kdiff3"]
cmd = /path/to/kdiff3 $BASE $REMOTE $LOCAL -o $MERGED
and it worked. But then kdiff3
reported this:
Not exactly what I expected: I had 4 conflicts and the tool says there are 2. Also the Nr of automatically solved conflicts
message makes me think that kdiff3
applies its own merging algorithm, which is the opposite of what we want.
kdiff3
automatically resolves conflicts based only on whitespaces issues. But you have a lot of options to configure in its settings if you want to change its behavior. See stackoverflow.com/a/15813064/6368697 : "if you really want to disable any automatic resolving, just add --qall to the kdiff3 command line". Also you said you have 4 conflicts and the tool says 2 but without seeing what you are seeing it is difficult to understand your situation and why the discrepancy.kdiff3
or any other tool to resolve conflicts on its own. I want it to respect the conflicts that git produces rather than redoing the merge.--qall
. From help: "Don't solve conflicts automatically.". I always thought it is one of its strength, so I do not have to loose time on trivial conflicts, but at least you have the option to disable it. YMMV.