How to use Visual Studio (vsdiffmerge) as external diff tool in SourceTree for Mercurial?
Solution 1
- You have a lot of useless (at least) blackslashes in commands and arguments
- Read Setting Up DiffMerge page, second chapter and fix own mistakes
Solution 2
For Visual Studio 2019 Enterprise vsDiffMerge.exe
location is:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe
Solution 3
For Visual Studio 2015
Put this line in the Diff Command box:
C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsDiffMerge.exe
And this one in the Arguments box:
$REMOTE $LOCAL $BASE $MERGED //m
Solution 4
With Visual Studio 2015 Update 1 and SourceTree 1.7.0.32509 this is only setting, which works for me:
C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsDiffMerge.exe
$REMOTE $LOCAL $BASE $MERGED //m
Solution 5
Here's the full answer for VS 2019 diff and merge, works with Git and Mercurial.
Diff:
Diff Command:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe
Arguments:
$LOCAL $REMOTE //t
Merge:
Merge Command:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe
Arguments:
$REMOTE $LOCAL $BASE $MERGED //m
If you have the Enterprise VS edition, change the paths to this: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe
Related videos on Youtube
Sombir Kumar
With 10 years of experience, Innovative Technical Lead working on the role of Architect in BOLD with proven success in software project consultancy and solutions implementation. Adept at identifying and designing integration points for different types of systems Building software frameworks and core modules for various BOLD products Involved in software performance optimization, redesign and documentation Expertise in cloud based development, Microsoft Azure, Web API, ASP .NET MVC, SQL Server, ASP .NET, .NET core, Microservices Architecture, Event Driven Architecture and Domain Driven Design Currently, part of the core architecture group and proactively participate in Organizational Architectural discussions Implementing reliable, scalable, secure and cost effective reusable components/boilerplate Possesses strong knowledge and understanding in Data structures and Algorithms, Object oriented programming concepts, SOLID Principle and Design Patterns
Updated on June 03, 2021Comments
-
Sombir Kumar almost 3 years
I am using Mercurial for my source control and SourceTree to manage it. I want to use Visual Studio's built in diff and merge tool (vsdiffmerge) for comparing files however this is not working.
I am currently using the following:
Diff Commands:
\"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe\"
Diff Arguments:
\"$LOCAL\" \"$REMOTE\" //t
Merge Commands:
\"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe\"
Merge Arguments:
\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" //m
The Visual Studio diff tool is not getting launched. Could you please take a look?
Update:-
We should use like below:- Diff Command: full path of vsDiffMerge.exe For VS 2015 and below you can find it in the Visual Studio installation folder, under Common7\IDE subfolder. Visual Studio 2017 has it slightly more hidden. Look under Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer. Diff Argument: "$LOCAL" "$REMOTE" "Source" "Target" //t Merge Argument: $LOCAL" "$REMOTE" "$BASE" "$MERGED" //m
-
Mladen B. over 7 yearsI like the "blackslashes" (black is back!) part :)
-
Jens Marchewka over 7 yearsI think remote and local are exchanged, aren't they?
-
BobbyVolley almost 3 yearsI tested it and it works exactly as described. Thanks a lot!
-
Denys Pyshniuk over 2 yearsMeanwhile, the update for Visual Studio 2022 Community vsDiffMerge.exe location is: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe