44

I am using SourceTree as a Git client in my windows 7. I faced with a conflict and in order to resolve I click on Launch external merge tool as suggested. A window pops up very shortly and nothing happens then after!

I just tried it on my Mac OS and it shows external merge tool as expected.

under Tools -> Options -> Diff -> External Diff / Merge dropdown box, System Default is selected.

I expect to see the diff merge tool but it never shows up in my windows, anyone know what could be the reason?

Ali
  • 9,800
  • 19
  • 72
  • 152

6 Answers6

27

Do you have a diff tool installed on your system?

In Mac, when you install Xcode you get a diff tool named FileMerge, simple but sufficient in most of the cases. You can try WinMerge for Windows, I've used it in the past and it's pretty nice, and open source.

You can also try the P4 Merge tool from Perforce which is offered for free.

Both options can be selected as a Diff/Merge Tool in SourceTree.

Sнаđошƒаӽ
  • 16,753
  • 12
  • 73
  • 90
Ricardo Amores
  • 4,597
  • 1
  • 31
  • 45
  • 4
    `Windows does not come with a diff tool preinstalled but Mac does.` I didn't know Mac came with a diff tool preinstalled. May I know which it is and where can I find it? – JohnnyQ Oct 09 '15 at 20:05
  • 4
    My fault, it does not come with OS X but with Xcode. You need to install Xcode, and the tool is named FileMerge. Don't know where is located, use Spotlight to search for it. It is pretty basic, but I find it good enough for most cases. – Ricardo Amores Oct 09 '15 at 20:12
  • Thanks will try that. I was using `DiffMerge` but looks like it's not working well with `El Capitan` update. – JohnnyQ Oct 09 '15 at 20:16
  • The one that comes with XCode is `opendiff` in the command line – nonopolarity Feb 14 '16 at 07:30
  • i did not find WinMerge as a Merge tool option - but only as Diff . maybe a different version ? also similar [info here](https://community.atlassian.com/t5/Questions/Can-t-launch-external-merge-tool-WinMerge-on-Windows/qaq-p/315156) – Obmerk Kronen Mar 25 '19 at 12:41
10

I suggest installing Kdiff3 as a diff tool. It's the best I've seen so far.

Then set it as the diff tool on SourceTree:

  • SourceTree/Tools/Options/Diff

The full tutorial is illustrated here: http://oliverbusse.notesx.net/hp.nsf/tutorial.xsp?documentId=C6A

Note that you must change both values for it to work. Otherwise it failed for me.

Michael Fayad
  • 1,216
  • 1
  • 17
  • 38
  • And how do I call this tool from the command line while pulling changes and having merge conflicts? – alexventuraio Mar 03 '22 at 22:38
  • @alexventuraio kdiff3 is very UI oriented. git and vimdiff seem like the preferred tools for command-line use. https://stackoverflow.com/questions/16408438/is-there-a-command-line-equivalent-to-kdiff3-that-allows-selective-merging https://stackoverflow.com/questions/53478816/merging-3-xml-files-with-kdiff3-command-line – Michael Fayad Mar 04 '22 at 19:57
4

Beyond Compare works great too on Mac. It supports Windows and Linux too, but I have not tried.

You can download it from https://www.scootersoftware.com/download.php and make sure you also install command line tools from top menu bar when you open Beyond Compare first time because Source Tree External Diff won't work without command line tools installed

2

This may happen due to Sourcetree couldn't fine '.gitconfig' file location. Even if you keep 'Allow Sourcetree to modify your global Git config files' check box ticked. The may not be updated.

Try adding, HOME in your system environment variables to the path of your '.gitconfig' file location. For e.g. HOME C:\Users\XXX

  • 1
    Without `Allow Sourcetree to modify your global Git and Mercurial config files` checked in General tab, I couldn't change my external diff tool in Diff tab. That option should be checked to set diff tools. Thanks! – cointreau Oct 05 '22 at 23:25
0

For newer versions of SourceTree, open the preferences by clicking [⌘ + ,] and under the Diff tab you can choose your tool(kdiff3, p4merge or the default is set to filemerge)

Dry_accountant_09
  • 1,371
  • 16
  • 15
0

Please make sure your file is not ignored in the SourceTree's Diff settings pane, textfield Ignore File Patterns.. I couldn't see Gemfile.lock's diff. I kept increasing the file size as per the instruction. I checked the file encoding as mentioned in other answers to similar questions. Turns out that when the file is ignored (by the SourceTree's Diff settings), it will display the same suggestion.

enter image description here

Chris Rutkowski
  • 1,774
  • 1
  • 26
  • 36