Visual Studio Tip #1: Ignoring Whitespace when Comparing

When comparing files, it’s frustrating when the default compare, doesn’t ignore whitespace, and many differences are caused by spaces vs tabs.

Solve it, by adjusting the parameters DiffMerge uses.

In Visual Studio:

  1. Tools->Options
  2. Source Control->Visual Studio Team Foundation Server
  3. Click the Configure User Tools button.

Now add an item with the following settings.

  • Extension : .*
  • Operation : Compare
  • Command : C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe
  • Or: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe
  • Arguments : %1 %2 %6 %7 %5 /ignorespace
Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

  • Chaks

    Hi,

    Do you have similar update for VS 2012 (which uses vsDiffMerge.exe). Options mentioned for DiffMerge.exe (VS 2010) are not working for VS 2012.

    Thanks.

  • Scott McFadden

    How do you do this in VS/TFS 2015 where there is no DiffMerge.exe?