0

I'm trying to set up vsDiffMerge (from Visual Studio Professional 2017) as my external merge/diff tool for SourceTree. However, when I try to resolve merge conflicts with the external tool, nothing happens. I know I got it to work before, but I had to reinstall Sourcetree recently, and now I can't get it to work.

Following the instructions in this article, I went to Tools > Options > Diff. I set the following:

  • External Diff Tool and Merge Tool both to Custom
  • Diff Command and Merge Command both to "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe"
  • Diff Command Arguments to "$LOCAL" "$REMOTE" "Source" "Target" //t
  • Merge Command Arguments to "$LOCAL" "$REMOTE" "$BASE" "$MERGED" //m

When merging, I right-click on a file with a merge conflict and choose Resolve Conflicts > Launch External Merge Tool. I see the "Visual Merge In Progress" message briefly and I can see in SourceTree that the temp files (the ones suffixed _BACKUP, _BASE, and _LOCAL) are created, but soon after the message goes away and the temp files disappear without the merge tool ever opening, leaving the conflict unresolved. The same happens whether I already have Visual Studio open or not.

I also tried swapping the order of $REMOTE and $LOCAL per this answer, but with the same results.

Is there something wrong with the way I have it set up? Is there anything else I should check or try?

inejwstine
  • 678
  • 1
  • 10
  • 30
  • Also, I think this is the right place for this question since the tool is used primarily for programming and I've seen similar questions on SO. However, if SU or some other site would be a better place for this question, let me know. – inejwstine Dec 06 '19 at 18:25

2 Answers2

1

I had the same problem in the most recent Sourcetree 3.4.6. It turned out that adding backslashes made it work:

  • Diff Command Arguments - \"$LOCAL\" \"$REMOTE\" //t
  • Merge Command Arguments - \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\" //m
TermiT
  • 11
  • 2
0

I never found out why it wasn't working for VS 2017, but I recently upgraded to VS 2019 and updated the path to the newly installed version of vsDiffMerge.exe and after doing that it works once again. So if anybody else runs into this issue, try updating Visual Studio.

inejwstine
  • 678
  • 1
  • 10
  • 30
  • I tried your ideal of vsDiffMerge and it does nothing, I am using ver. 3.4.12 was there anything special u had to do. I cannot get TortoiseMerge either. No error and no merge tool pops up. – Glen Jun 08 '23 at 02:38