FileMerge quits immediately after launching from SourceTree

Greg Kopff picture Greg Kopff · Sep 23, 2015 · Viewed 11.1k times · Source

I regularly use Atlassian SourceTree (on Mac OS X) to launch FileMerge to resolve git merge conflicts. Out of the blue it has stopped working: when I right click and select Resolve Conflicts > Launch External Merge Tool, FileMerge launches, creates its intermediate files, then immediately exits. SourceTree interprets that as the merge process being complete.

What's the issue and how can I debug/fix it?

I note that a previous question 'SourceTree filemerge quits immediately and creates 4 files. How to fix it?' does not address this particular scenario (for one, it says FileMerge quits in the title, but in the body it says FileMerge displays /dev/null as one of the panels. Additionally, my merge conflict is not due to a removed file.)

Answer

ChrisJF picture ChrisJF · Jan 5, 2017

To diagnose the problem, I ran opendiff from the Terminal. I received the following error:

xcode-select: error: tool 'opendiff' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

To solve:

  1. Open Xcode > Preferences > Locations
  2. Click on the drop-down box beside Command Line Tools and select your current Xcode version. (This was empty for me because I had recently installed Xcode on a new Mac.)

Command Line Tools

  1. Run opendiff in Terminal again, and the above error should no longer appear.

Now FileMerge will open correctly from SourceTree when you click Launch External Merge Tool.