如何配置TFS以使用各种合并工具

Jus*_*ing 26 merge tfs winmerge beyondcompare

最初的问题是"如何将WinMerge配置为TFS的比较和合并工具".但是,我正在改变它,因为TehOne回答了这个问题的更一般形式.

虽然我会在Stackoverflow上已经提出过这个问题.我在其他地方找到了答案,但我在这里问/回答.它现在是一个社区维基.

Teh*_*One 33

当我在寻找如何做到这一点时,我发现这篇文章非常宝贵:http: //blogs.msdn.com/jmanning/articles/535573.aspx


Jus*_*ing 12

漫长的程序在Rory Primrose博客文章中提供

简短的回答是比较的参数列表是:

/x /e /ub /wl /dl %6 /dr %7 %1 %2
Run Code Online (Sandbox Code Playgroud)

并且合并的参数列表是:

/x /e /ub /wl /dl %6 /dr %7 %1 %2 %4
Run Code Online (Sandbox Code Playgroud)

有时Winmerge不会返回0并且TFS会认为合并已取消.您需要使用以下包装批处理文件进行合并:

@rem winmergeFromTFS.bat
@rem 2007-08-01
@rem File created by Paul Oliver to get Winmerge to play nicely with TFS
@rem
@rem To use, tell TFS to use this command as the merge command
@rem And then set this as your arguments:
@rem  %6 %7 %1 %2 %4
"C:\Program Files\WinMerge\WinMerge.exe" /x /e /ub /wl /dl %1 /dr %2 %3 %4 %5
exit 0
Run Code Online (Sandbox Code Playgroud)

然后将参数列表设置为:

%6 %7 %1 %2 %
Run Code Online (Sandbox Code Playgroud)

退出0