I am using TFS for source control, but I want to use SourceGear DiffMerge for viewing file differences and doing merges. I found the Tools -> Options -> Source Control -> Visual Studio Team Foundation Server -> Configure User Tools dialog, but setting up the merge parameters is very confusing. What should those parameters be?
-
possible duplicate of [How do I configure TFS to work with various merge tools](http://stackoverflow.com/questions/1313908/how-do-i-configure-tfs-to-work-with-various-merge-tools) – James Reed Jul 08 '13 at 19:47
4 Answers
These are the SourceGear settings that I use:
C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe
Compare:
/t1=%6 /t2=%7 %1 %2
Merge:
/m /r=%4 /t1=%7 /t2=%8 /t3=%6 /c=%9 %2 %3 %1

- 61,933
- 36
- 195
- 321
-
I +1'd this but regret it as I @Colin Bacon's order is more intuitive and fits the standard pattern established in http://stackoverflow.com/a/1313961/11635 – Ruben Bartelink Dec 23 '14 at 20:47
These are my settings. Can't remember where I got them from but I have used them in VS2010, VS2012, VS2013.
C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe
Compare
/title1=%6 /title2=%7 %1 %2
Merge
/title1=%6 /title2=%8 /title3=%7 /result=%4 %1 %3 %2

- 15,436
- 7
- 52
- 72
-
My guess is you may have got them from [this MSDN blog](http://blogs.msdn.com/b/jmanning/archive/2006/02/20/diff-merge-configuration-in-team-foundation-common-command-and-argument-values.aspx) – oatsoda Aug 06 '15 at 16:38
Firstly, you need to change the default command line to:
C:\Program Files (x86)\SourceGear\Vault Client\sgdm.exe
I found the parameters in this thread on the SourceGear support forums, but the arguments given there are incorrect and result in the auto-merge being executed in reverse, i.e. old code overwrites new code. The correct arguments are:
/m /t1=%6 /t2=%7 /t3=%8 /c=%9 %1 %3 %2 /r=%4

- 36,951
- 69
- 249
- 387
-
@RubenBartelink: Note my comment there. "The parameters he uses for SourceGear DiffMerge are incorrect. The correct parameters can be found here." Try it out. If you use the parameters listed there, the auto-merge chooses exactly the wrong code as the merge result. – Shaul Behr Dec 24 '14 at 07:45
-
Hmm. I'm using the args from Colin Bacon's asnwer and they seem to work, but I was under the illusion that I was using the ones from the 'universal' blog post for 6 years with no such ill effects - perhaps that's because arg order/semantics changed across sgdm versions (doesnt seem too likely though). Will analyze and report back at some point... – Ruben Bartelink Dec 26 '14 at 21:38
-
Hmm, still using the other config happily - have not taken the time to understand your point as things still seem to work in a nice predicatable fashion that way... – Ruben Bartelink Jan 07 '15 at 08:03
-
@RubenBartelink do the experiment of simulating two non-conflicting changes to one file by two different users, and perform an automatic merge. Try with both sets of parameters and see how differently the merge gets resolved. – Shaul Behr Jan 07 '15 at 08:22
-
OK, I'll keep it on my TODO list - it's just tight at the top of it :( – Ruben Bartelink Jan 07 '15 at 11:03
-
I'm using this now and it's Doing What I Mean. Thanks for pushing! – Ruben Bartelink Feb 02 '15 at 22:20
-
-
=> It reads my mind and Just Works for the situations I use it in without me actually being able to necessarily explain in depth what it is that I Mean. (Reference to an ex-colleague's frequent assertion that the really 'all' the User is asking for is a simple Do What I Mean button) – Ruben Bartelink Feb 03 '15 at 12:03
-
@RubenBartelink So, to be clear, does it work with the parameters as I said, or the other way? – Shaul Behr Feb 03 '15 at 15:05
-
1ah, sorry - I upvoted and 'this' refers to your parameters as above – Ruben Bartelink Feb 03 '15 at 20:45
For some reason my old settings for DiffMerge with %1 %2 stopped working, error "File not found (%1). File not found (%2)."
Changed it to:
"C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe" $(Base) $(Mine)

- 6,487
- 8
- 50
- 64