FileMerge fails on OS X 10.7 and Xcode 4.2

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

The FileMerge option cannot be performed.

Diagnosis

Environment

  • Mac OS X 10.7 - Lion

  • Xcode 4.2

Cause

When installing Xcode 4.2, the opendiff command line tool is moved from /usr/bin to /Developer/usr/bin. However, the path to the command is not added to the PATH list and this causes to command to fail.

Solution

Resolution options

Resolution 1

Create a symbolic link to the new location of the opendiff command

1 sudo ln -s /Developer/usr/bin/opendiff /usr/bin/opendiff

Resolution 2

Add /Developer/usr/bin to your path. You will need to do this in two locations:

  1. /etc/paths - this is the $PATH that the SourceTree user interface uses (Note: a computer restart may be required for this change to be effective)

  2. Your ~/.bash_profile or similar

Additional resolution option

It may still occur, that the command is still failing after having applied one of the option above.

If this is the case, try running the opendiff command from the command line, in case you get a response like the following:

1 2 xcode-select: Error: No Xcode folder is set. Run xcode-select -switch <xcode_folder_path> to set the path to the Xcode folder. Error: /usr/bin/xcode-select returned unexpected error.

then run this command on the terminal:

1 sudo xcode-select -switch /Developer

After this step, the opendiff command, as well as the SourceTree FileMerge, should be working as expected.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.