Visual Studio TFVC合并行未对齐 [英] Visual Studio TFVC Merge Lines Misaligned

查看:90
本文介绍了Visual Studio TFVC合并行未对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Visual Studio 2017与Team Foundation版本控制(TFVC)一起使用.我试图将更改从父分支合并到子分支,但是我遇到了许多本不应该存在的冲突.比较功能可以很好地工作并显示出完全不同的一面,但是合并工具试图像将一副纸牌一样将2组代码改组在一起.太糟糕了,我会更安全地手动进行更改.

有没有一种方法可以帮助合并工具识别可比的代码行?

解决方案

您可以尝试使用外部比较amd合并工具,例如 ExamDiffPro 超越比较.

例如:

使用超越比较作为外部合并工具:

转到工具 | 选项 | 源代码控制 | Visual Studio Team Foundation Server ,然后单击配置用户工具,然后单击添加.输入以下内容:

Extension: *
Operation: Merge
Command: <Path to BCompare.exe>
Arguments: /merge %1 %3 %2 /o:%4 /dn1:%6 /dn2:%8 /dn3:%7 /dno:%9 /nh 

然后,当您单击合并工具中的更改以解决冲突时,它将调用外部比较和合并工具.根据我的测试,它可以识别出可比的线.

对于ExamDiff,您可以参考:使用ExamDiff Pro作为外部Diff工具

I am using Visual Studio 2017 with Team Foundation Version Control (TFVC). I am trying to merge changes from a parent branch into a child, but I am getting tons of conflicts that shouldn't exist. The compare function works fine and shows a hand full of difference, but the merge tool is trying to shuffle the 2 sets of code together like a deck of cards. It's so bad, I would feel safer making the change manually.

Is there a way to help the Merge Tool identify the comparable lines of code?

解决方案

You can try the external Compare amd Merge Tools, e.g WinMerge, ExamDiffPro or Beyond Compare.

For example:

Using Beyond Compare as an External Merge Tool:

Go to Tools | Options | Source Control | Visual Studio Team Foundation Server, then click Configure User Tools and then Add. Enter the following:

Extension: *
Operation: Merge
Command: <Path to BCompare.exe>
Arguments: /merge %1 %3 %2 /o:%4 /dn1:%6 /dn2:%8 /dn3:%7 /dno:%9 /nh 

Then it will invoke the external compare and merge tool when you click Merge Changes in Merge Tool to resolve the conflicts. And based on my test it can identify the comparable lines.

For ExamDiff, you can reference : Using ExamDiff Pro as an External Diff Tool

这篇关于Visual Studio TFVC合并行未对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆