Blogs about Jazz

Blogs > Jazz Team Blog >

Using Visual Studio’s built-in diff/merge tool with Rational Team Concert

The IBM Rational Team Concert client for Microsoft Visual Studio IDE comes with a default file compare utility, but also allows you to use any external compare tool of your choice.  The compare utility that you use will come up in a separate window that you’d need to switch to in order to perform the diff/merge operations. While this offers a lot of flexibility to users in terms of using the compare tool of their own choice, the user experience could perhaps be improved if there were a compare tool that could offer a “within-the-IDE” experience. In this blog I’ll talk about one such compare tool and how to use it.

With Visual Studio 2012 came a new diff/merge experience based on the Visual Studio editor, which means that you do not have to leave the IDE for file comparison. RTC .NET users have since asked us if they can configure the Rational Team Concert integration to use Visual Studio’s built-in diff/merge editor. While we haven’t yet made this an out-of-the-box officially supported tool, if you have learned of its benefits and want to try it out as a custom compare tool, read on.

You can open the built-in diff/merge editor in Visual Studio using the vsDiffMerge command line tool. To configure this tool for comparing and merging files under Jazz Source Control, from the main menu of Visual Studio, open Tools > Options.  Expand to Source Control > Jazz Source Control > Compare Tools options page.  Choose the <Custom> External Compare Tool from the drop down.  Click Browse… to select the Visual Studio version specific vsDiffMerge.exe executable.

Jazz Source Control Compare Tools Options

Jazz Source Control Compare Tools Options

In the image above, I have configured Visual Studio 2015 with the location of the corresponding executable which is at “C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\vsDiffMerge.exe” in my machine.

NOTE: The Compare options of Jazz Source Control are specific to the Visual Studio version, so if you are using more than one version of Visual Studio, configure each version with the path to the vsDiffMerge.exe executable installed with it. The executable has been relocated in Visual Studio 2017.

For 2-Way Compare, use these arguments (optionally use the /t argument to open the comparison in a preview tab):

/t "${file2Path}" "${file1Path}" "${file2Title}" "${file1Title}"

For 3-Way Compare, use these arguments:

/m "${file1Path}" "${file2Path}" "${ancestorFilePath}" "${mergeFilePath}" "${file1Title}" "${file2Title}" "${ancestorFileTitle}" "${mergeFileTitle}"

The following image shows a merge window opening inside the IDE when a file in conflict is double clicked from the Pending Changes view.

Visual Studio’s built-in diff/merge editor

Visual Studio’s built-in diff/merge editor

TIP: Get more out of the Diff window by enabling the Compare Files toolbar:

Visual Studio Compare Files toolbar

Visual Studio Compare Files toolbar

Priyadarshini Gorur
Technical Lead, Rational Team Concert .NET Clients, Persistent Systems,,