I try to use SourceTree with P4Merge, but I always had issues with it (merge tool sometime starting sometime not). I searched SourceTree fails to start P4merge many times, without much result.
So I tried it with KDiff3 instead - but the results were the same.
I searched SourceTree fails to start merge tool, and found this: https://community.atlassian.com/t5/Sourcetree-questions/Launch-external-merge-tool-does-not-actually-launch-anything/qaq-p/11193
It gave the idea to look at the .gitconfig file, which seems to show the source of the problem: my .gitconfig is corrupted:
[difftool "sourcetree"]
cmd = 'C:/Program Files/Perforce/p4merge.exe' \"$LOCAL\" \"$REMOTE\"
cmd = 'C:/Program
cmd = 'C:/Program
cmd = 'C:/Program
cmd = 'C:/Program
cmd = 'C:/Program
[mergetool "sourcetree"]
cmd = "'' "
trustExitCode = true
cmd = 'C:/Program
cmd = 'C:/Program
I never used any tool other than SourceTree to change my diff and merge tools, so I think I can safely say that SourceTree corrupts the .gitignore file when I use SourceTree / Tools / Diff / diff and merge configuration (with the slight chance of some other tool's installer doing it).
I managed to fix it by changing .gitconfig to look like this (other parts of .gitconfig not included):
[diff]
tool = sourcetree
[difftool "sourcetree"]
cmd = 'C:/Program Files/Perforce/p4merge.exe' \"$LOCAL\" \"$REMOTE\"
[merge]
tool = sourcetree
[mergetool "sourcetree"]
cmd = 'C:/Program Files/Perforce/p4merge.exe' \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
trustExitCode = true
et voilá!
I have a working merge tool in SourceTree!
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.