The external diff tool in SourceTree (windows version) is not working at all. When system default is used, it tries to run vim.exe (presumably for vimdiff?), but nothing happens, vim.exe will just keep using the CPU resource until it's forced to terminate. Any other "out-of-the-box" tools I tried (kdiff3 and diffmerge) doesn't work as well. I tried looking at the sourcetree.exe.config, and found out that the difftool value is set to -1.
What is the correct way to setup a external difftool (and mergetool) for Window's SourceTree? Does it have to run under administrator privilege?
'System default' means whatever you have configured in your .gitconfig already as your default diff tool. SourceTree doesn't change this one - it's there so that ST will by default just pick up anything you've already configured yourself - in your case you must have configured something to use vim at some point.
If you want SourceTree to configure a tool you should just be able to select the one of your choosing from the drop-down. I just tried Araxis, DiffMerge and KDiff3 here (I usually use P4Merge personally) and they all worked fine when I chose them. SourceTree doesn't run as admin, it runs as your own user but that should be enough to find things - when you pick a tool it searches for it by checking the registry (read-only) and also the common file locations (program files) - read only permissions should be fine.
If you still can't get this to work, please have a look at the .gitconfig file in your home directory, which is what ultimately gets used to open the external diff tool.
Thanks for the quick response.
1. Yes, I know the default is from git default. I didn't change anything for git diff, so it is vimdiff, and it works fine from gitbash.
2. I tried selecting kdiff3 and diffmerge, both doesn't do anything.
3. I just tried using the embedded git for sourcetree, still doesn't work.
I'm actually fine with using vimdiff, but the problem is it doesn't show up. It just loads the vim.exe in the background, and nothing else. So I figured I'd use something else, but it turns out they don't work.
I'm suspecting it is the sourcetree config that has problems. The "difftool" and "mergetool" setting in sourcetree.exe.config has a value set -1. Is this supposed to be the case?
The value of -1 in the config is fine, it means 'System Default'. The SourceTree.exe.config alongside SourceTree.exe just defines the out-of-the-box settings, when you change any settings they get saved as 'user.config' under your %USERHOME%\AppData\Local folder (exactly where depends on which version you're using, the new installer puts them in Atlassian\SourceTree.exe_xxxxxx\versionno\user.config). So that's almost certainly not the issue.
I installed both kdiff3 and diffmerge using their regular installer.
I have cygwin, but I don't install vim there. In fact, the only vim I have is from git installation (under the share folder).
I tried to set gitbash to use kdiff as the difftool, works fine there, but still nothing from sourcetree.
Is there a path that I need to include or anything? If I were to uninstall git completely and use the embedded version, what will be the default diff tool?
Can I see your .gitconfig after you've configured kdiff yourself, and after you've configured it in SourceTree? ST actually creates an extra diff entry in parallel to your manually configured ones so we should just be able to compare them directly to see what the difference is.
[diff] tool = kdiff3 [difftool] prompt = false [difftool "kdiff3"] path = C:/Program Files (x86)/KDiff3/kdiff3.exe trustExitCode = false [merge] tool = kdiff3 [mergetool] keepBackup = false [mergetool "kdiff3"] path = C:/Program Files (x86)/KDiff3/kdiff3.exe trustExitCode = false
Those are the settings I used. AFAIK, there is no change after I set ST to use kdiff3.
AFAIK, there is no change after I set ST to use kdiff3
That probably explains why it's not working. What you should see is something like this after you configure anything other than 'System Default' in SourceTree:
[difftool "sourcetree"] cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' \"$LOCAL\" \"$REMOTE\" [mergetool "sourcetree"] cmd = 'C:/Program Files/Araxis/Araxis Merge/compare.exe' -wait -merge -3 \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"$MERGED\" trustExitCode = true keepBackup = false
The fact that you don't have any entries like that suggests that the .gitconfig you're looking at isn't the one SourceTree is using. For that to happen, your command line must see a different .gitconfig - are you changing your HOME directory or other home-related settings in your bash .profile or similar, which is therfore only visible to bash? SourceTree uses the following rules to locate your global git config:
This is where it will be getting its settings from.
I have the same issue : setting a diff/merge tool does not change the ST.config file. I have Tortoise Git installed, and I would like to use tortoiseGit Diff and Merge tools but no way...
I would preferer to avoid modifying the git config file if possible.
Did I miss something ?
Edit : When I set tortoise as tool, ST creates the merge file (in case of a conflict) (LOCAL, ETC...) but does not start any tool.
I also switched now to Git Extensions. This lock issue was now tip of the iceberg.
Sorry, back in 2015, I really liked the tool and it helped me to get familiar with GIT...
I'm using Sourcetree on a Mac with a Mercurial repository on Bitbucket. I'd like to get it working with BBEdit. Installed the command line tools (bbdiff) and it is working fine from the Terminal but it won't launch BBEdit. This video shows what is happening.
I tried to follow the instructions on how to edit the configuration files but it shouldn't be this difficult to get it working.
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs