Friday, January 20, 2012

Visual studio compare and merge goodness



When doing a diff more complex than a == b using the standard diff/merge tool that comes with visual studio is an experience that no developer should need to go  through. I don't think that diff tool has changed since the black Visual SourceSafe days.

But there is a way to make your life so much nicer. I use WinMerge as the diff tool when in visual studio.
Follow this steps if you want to get rid of (some atleast) of the pains of merging code:

1. Download and install WinMerge
2. In Visual Studion go to Tools -> Options -> Source control ->Visual Studio Team Foundation Server and click on the Configure User Tools button.
3. If you don't have the two commands for compare and merge, then add one for each and set the file path to your WinMerge executable, mine is C:\Program Files (x86)\WinMerge\WinMergeU.exe. The extension should be .*
3a. The arguments for compare is /e /x /s /wl /dl %6 /dr %7 %1 %2
3b. and for merge /e /s /x /ub /dl %6 /dr %7 %1 %2 %4

Done!
Now next time you do a merge diff or compare Visual studio will use WinMerge instead.

2 comments :

  1. The next version of Visual Studio have a modern compare tool, only took them like 10 years to make a new one :)

    ReplyDelete
  2. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future... bet9ja mobile

    ReplyDelete