5

I am running OS X.10, Xcode 7 and SourceTree 2.

When I select a conflicted file and Launch an external merge tool, there is a window that appears very briefly... and then nothing happens.

I tried (see this help page) sudo ln -s /Developer/usr/bin/opendiff /usr/bin/opendiff but it did not work (I got the message ln: /usr/bin/opendiff: File exists).

What should I do?

PS:

Here is a picture of the window that briefly appears.

enter image description here

PPS:

Here are the SourceTree preferences:

enter image description here

  • Note that that help pages says it is for Xcode 4.2 and was written a few years ago - what version of Xcode do you have? Also anything that says chnage things in /usr/bin is a suspect source and now will not work in El Capitan. Also the error is because you already have /usr/bin/opendiff so the whole change is pointless – Mark Nov 4 '15 at 22:03
  • Have you run Xcode and agreed to the licence terms – Mark Nov 4 '15 at 22:06
  • I run Xcode 7 indeed! (but does this really make a difference?) – Colas Nov 4 '15 at 22:08
  • Have you installed command line tools? What does /usr/bin/opendiff show when run in the terminal – Mark Nov 4 '15 at 22:10
  • 2015-11-04 17:11:32.360 opendiff[10848:132187] too few arguments 2015-11-04 17:11:32.365 opendiff[10848:132187] usage: opendiff file1 file2 [-ancestor ancestorFile] [-merge mergeFile] – Colas Nov 4 '15 at 22:11
2
+50

Assuming you are on latest version of SourceTree (Version 2.0.5.5 (2.0.5.5))

Try adding the following manually to your .gitconfig (or verify that SourceTree has put these exact lines)

[mergetool "sourcetree"]
    cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
    trustExitCode = true
0

My problem was that I was running a previous version of Xcode and I hadn't set the command line tools.

Select the tools in Xcode's preferences -> locations:

enter image description here

Then run this command in terminal to verify:

git config --global -l

The git command will print out the path for the diff tool, amongst other config info. If it's not configured, it will output an error with something along the lines of the following:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .