How do I use Git's `difftool` to merge conflicts?
Asked Answered
A

2

42

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?

Atavistic answered 18/9, 2010 at 13:48 Comment(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.Arboriculture
M
43

Try git mergetool.

Misericord answered 18/9, 2010 at 14:8 Comment(2)
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.Atavistic
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.Rabia
R
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.

Ritz answered 18/9, 2010 at 14:28 Comment(3)
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.Atavistic
In that case I would agree with 3lectrologos. I normally do this with git mergetool.Ritz
It's a bit hard to tell from the support site, but I think mergetool support is not yet in Kaleidoscope, only difftool.Diondione

© 2022 - 2024 — McMap. All rights reserved.