43

After a merge failed with some conflicts, I can list those with git diff, but git difftool won't display them with the difftool set in the config (in my case Kaleidoscope). Instead it will just use normal diff.

A git difftool comparing with a previous commit will work.

Is there a way to use git difftool on merge conflicts?

1
  • 1
    I have had this exact experience, but using meld instead of Kaleidoscope. git meldtool works, but git difftool reverts to git diff even though it works normally when there isn't a merge conflict to resolve. I thought it was odd. Commented Aug 20, 2012 at 22:49

2 Answers 2

44

Try git mergetool.

Sign up to request clarification or add additional context in comments.

3 Comments

Mergetool will start an visual merging attempt e.g another app, I simply want a diff off the 2 conflicting files, the problem is that although git difftool refA refB normaly works, a git diff and git diftool will do the same in this case.
Would be a better answer if it supported the same options, such as --dir-diff. It doesn't, so it's kind of a craptastic option.
Yes. But also you have to configure "mergetool" section in your HOME/.gitconfig and add there proper command, for example cmd = /usr/bin/kdiff3 \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"--output=$MERGED\".
2

Firstly try:

git difftool -t <yourtool> 

If that doesn't work, look at man git-difftool and check the list of supported tools. Check if one of those does what you want, if it does then you've narrowed it down to git not supporting Kaleidoscope, which may need some other config tweaking.

3 Comments

I already configured it and git difftool refA refB works fine, what I want to do is use difftool when a merge failed do display the differences in the conflict files, git diff defaults works at this point but using difftool does the same as diff. It doesn't start kaleidoscope but it uses diff too.
In that case I would agree with 3lectrologos. I normally do this with git mergetool.
It's a bit hard to tell from the support site, but I think mergetool support is not yet in Kaleidoscope, only difftool.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.