FileMerge quits immediately after launching from SourceTree

前端 未结 5 1567
清酒与你
清酒与你 2021-01-31 07:57

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

相关标签:
5条回答
  • 2021-01-31 08:08

    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.)

    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.

    0 讨论(0)
  • 2021-01-31 08:08

    If Xcode has recently updated itself, you may need to agree to the new license terms. If you have not agreed to the license terms, FileMerge (when launched from SourceTree) will quit immediately.

    To check for this, open a shell and run as your usual user:

    $ opendiff
    

    If the license is the problem, it will tell you. To agree to the new license terms, you'll need to run open diff using sudo:

    $ sudo opendiff
    

    After agreeing to the license terms, you can now retry launching FileMerge from SourceTree using Resolve Conflicts > Launch External Merge Tool. FileMerge should launch and behave normally.

    0 讨论(0)
  • 2021-01-31 08:10

    This also works to resolve the message "xcode-select: error: tool 'opendiff' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance":

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    
    0 讨论(0)
  • 2021-01-31 08:14

    This helped: https://gist.github.com/kylefox/4512777

    Tell system when Xcode utilities live:

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

    Set "opendiff" as the default mergetool globally:

    git config --global merge.tool opendiff

    0 讨论(0)
  • 2021-01-31 08:30

    For me, SourceTree didn't even launch FileMerge. When clicking Launch External Merge Tool nothing happened.

    Moreover, running opendiff in Terminal worked as expected:

    $ opendiff
    opendiff[64176:5561154] too few arguments
    opendiff[64176:5561154] usage: opendiff file1 file2 [-ancestor ancestorFile] [-merge mergeFile]
    

    What helped me was manually configuring SourceTree to use FileMerge via the opendiff command with the following arguments: $LOCAL $REMOTE -ancestor $BASE -merge $MERGED

    This way, SourceTree opens FileMerge as expected.

    0 讨论(0)
提交回复
热议问题