Skip to content

Three-way merge in TFS

by drphrozen on December 19th, 2014

Hi there!

For some year i have been working with Visual Studio and all sorts of revision systems (cvs, svn, git, dropbox *oops* and tfs).
Lately our projects has been using TFS, but some are starting to enjoy Git (although mostly hipsters and other command line fanatics). Personally i use Git at home and TFS at work.

Well enough blabber, this post is about three-way merges in TFS *hint: see title*.

I’m normally a fan of the tools in Visual Studio, but i never liked how their file comparison looked.
Personally i like Perforces p4merge way better. It seems to handle merge conflicts way better than the built in tools (at least compared to 2012 and 2013). It has some neat options for whitespace handling, and the only drawbacks are file encodings (but this might just be the way that Visual Studio by default uses BOM) and the annoying/lack of integration in Visual Studio.

I have been using this guide when i had to setup p4merge in Visual Studio, which results in a command line pop up followed by p4merge. It works, but that command line thing is just annoying :)

So i created an exe instead and copied the logic from the bat files (and merged it into one exe to rule them both: merge and diff).

Next i created a simple Powershell script that makes Visual Studio use: p4merge_vs.exe.


Download p4merge_vs_install.exe and run it.

Warning, this will overwrite all the .* extension for your User Tools in all installed versions of Visual Studio, if you have any.

That’s it, enjoy!

Manual Install

Copy only p4merge_vs.exe to Perforce folder and configure it in Options > Source Control > Visual Studio Team Foundation Server > User Tools

Visual Studio User Tools Diff

Visual Studio User Tools Merge



From → Uncategorized

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS