0

I've successfully set up Kaleidoscope as my default git difftool, and works like a charm. But when I make a fetch then git difftool, I can see what has changed, yet I cannot choose or merge what I want (at least not through Kaleidoscope).

Now, I want to set up File Merge (the Merge app bundled with XCode) as my mergetool so I can fetch, see what has changed, and choose what to merge.

Is this possible? If so, how can I set this up?

My apologies in advance for a noobish question.

AeroCross
  • 3,969
  • 3
  • 23
  • 30

1 Answers1

1

I use SourceGear's DiffMerge application for merging. It's much better than opendiff (the Xcode merge tool), and that's my recommendation for you. You can use the principles below to configure opendiff instead if you really want to, but it's much less powerful than DiffMerge.

My global git config file contains:

[mergetool "diffmerge"]
        cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
        trustExitCode = false
[merge]
        tool = diffmerge

So now when there are merges to do, I say "git mergetool" and it'll prompt me to launch DiffMerge for each file that needs merging. I can choose from all the options for the file, save it into a resolved file, and go. It's very nice.

Dan Ray
  • 21,623
  • 6
  • 63
  • 87
  • This seems to be working like a charm, yet I can't use it to fetch then merge - any pointers on how to do this? – AeroCross Sep 20 '11 at 23:41
  • Well, you don't necessarily use a merging tool to "fetch then merge". You use it to resolve merging conflicts. If you `git pull`, it'll merge what it can happily on its own, and bellyache about any merge conflicts it can't resolve. Then if you say `git mergetool`, it'll walk through the conflicted files, allowing you to resolve them manually. – Dan Ray Sep 21 '11 at 12:12
  • I finally had the chance to test DiffMerge and works like a charm - the 3 way merge being specially awesome. The thing is that it doesn't work with UTF-8 characters, or am I missing something? – AeroCross Oct 04 '11 at 15:01