TFS diff merge tools Visual Studio Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/tag/tfs-diff-merge-tools-visual-studio/ Production Grade Technical Solutions | Data Encryption and Public Cloud Expert Tue, 18 Oct 2011 19:01:48 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://www.anujvarma.com/wp-content/uploads/anujtech.png TFS diff merge tools Visual Studio Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/tag/tfs-diff-merge-tools-visual-studio/ 32 32 Diffs and Merges–Better Tools for TFS https://www.anujvarma.com/diffs-and-mergesbetter-tools-for-tfs/ https://www.anujvarma.com/diffs-and-mergesbetter-tools-for-tfs/#respond Tue, 18 Oct 2011 15:26:09 +0000 http://www.anujvarma.com/diffs-and-mergesbetter-tools-for-tfs/ One of the most frequent tasks that developers face is ‘comparing’ (diff between) two versions of a source file.  Another related task is that of merging two (or more versions of) […]

The post Diffs and Merges–Better Tools for TFS appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
One of the most frequent tasks that developers face is ‘comparing’ (diff between) two versions of a source file.  Another related task is that of merging two (or more versions of) files. The built-in comparer/merger in Visual Studio is extremely limited in this regard. There are two tools (Beyond Compare and WinMerge) out there that I have used and would recommend over the built-in comparison viewer.

Beyond Compare (free for 30 day trial only, then approximately $50 for a user license)

To configure the diff and merge to work with this tool, follow the instructions here. A quick recap of configuring it for use with TFS is given below: 

Configuring Beyond Compare as the Diff tool in TFS

  1. In Visual Studio Choose Options from the Tools menu.
  2. Expand Source Control in the treeview.
  3. Click Visual Studio Team Foundation Server in the treeview.
  4. Click the Configure User Tools button.
  5. Click the Add button.
  6. Enter “.*” in the Extension edit.
  7. Choose Compare in the Operation combobox.
  8. Enter the path to BComp.exe in the Command edit.
  9. In the Arguments edit, use:
    %1 %2 /title1=%6 /title2=%7

Configuring Beyond Compare as the 3-way Merge tool (v3 Pro)

  1. Follow steps 1-6 above.
  2. Choose Merge in the Operation combobox.
  3. Enter the path to BComp.exe in the Command edit.
  4. In the Arguments edit, use:
    %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9

Configuring Beyond Compare as the 2-way Merge tool (v3 Std, v2)

  1. Use the same steps as the 3-way merge above, but use the command line:
    %1 %2 /savetarget=%4 /title1=%6 /title2=%7

Winmerge (free, non-expiring version available)

In Visual Studio do the following:

  • Click on Tools menu
  • Click on Options menu item
  • Expand Source Control tree item
  • Select Visual Studio Team Foundation Server tree item
  • Click on Configure User Tools… button

Configuring WinMerge for Comparisons (Diffs)

To use WinMerge as the Compare/Diff tool:

  • Click the Add… button
  • For Extension, type *
  • For Operation, select Compare
  • For Command, browse for C:\Program Files\WinMerge\WinMerge.exe
  • For Arguments, type /x /e /ub /wl /dl %6 /dr %7 %1 %2
  • Click OK to accept

Configuring WinMerge for Merging

To use WinMerge as the Merge tool:

  • Click the Add… button
  • For Extension, type *
  • For Operation, select Merge
  • For Command, browse for C:\Program Files\WinMerge\WinMerge.exe
  • For Arguments, type /x /e /ub /wl /dl %6 /dr %7 %1 %2 %4
  • Click OK to accept

Summary

The built in diff and merge tools in TFS (and VSS) are extremely limited. To get around these limitations, use either WinMerge (free) or Beyond Compare (free for 30 days only) – and configure these in Visual Studio as described in this post.

The post Diffs and Merges–Better Tools for TFS appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/diffs-and-mergesbetter-tools-for-tfs/feed/ 0