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?
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
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
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
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)
来源:https://stackoverflow.com/questions/17523971/how-to-set-up-sourcegear-diffmerge-as-the-diff-merge-tool-for-visual-studio