如何使用Visual Studio 2013在TFS中正确合并两个分支? [英] How to correctly merge two branches in TFS using Visual Studio 2013?

查看:94
本文介绍了如何使用Visual Studio 2013在TFS中正确合并两个分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TFS来控制我的c#ASP.NET MVC项目。我的项目名为  ProjectA
它有两个分支(即  ProjectA     ProjectA-Dev 。)  ProjectA  
我的生产分支,  ProjectA-Dev  
我的开发分支。  ProjectA-Dev   包含
我项目即将发布的许多新代码。

I am using TFS to source control my c# ASP.NET MVC projects. I have a project called ProjectA, It has two branches (i.e ProjectA and ProjectA-Dev.) ProjectA is my production branch, and ProjectA-Dev is my development branch. ProjectA-Dev contains lots of new code for my project's upcoming release.

我正处于一个阶段,我需要从生产到开发获取任何更改。我的生产版本在我的  中处理我的下一个版本时几乎没有错误修复 ProjectA-Dev
我想在我的  ProjectA-Dev   分支。

I am at a stage that I need to obtain any change from production into dev. My production version have few bug fixes while I was working on my next release in ProjectA-Dev. I want to obtain the added bug fixes into my ProjectA-Dev branch.

合并   ProjectA   进入  ProjectA-dev
我打开"Solution Control Explorer",右键单击  ProjectA   然后
on"Branching and Merging"然后点击"Merge"。

To merge ProjectA into ProjectA-dev, I opened "Solution Control Explorer", right clicked on ProjectA then on "Branching and Merging" then on "Merge".

在源代码控制合并向导中,我选择了  $ / TFS / ProjectA   。然后选择  $ / TFS / ProjectA-Dev   。然后我点击"下一步",选择编辑"最新版本"并点击"完成"。

On the Source Control Merge Wizard I selected $/TFS/ProjectA in the source branch. Then selected $/TFS/ProjectA-Dev in the target branch. Then I hit "Next", select ed "Latest Version" and hit "Finish".

该过程运行10秒钟然后它给我这个错误 

The process runs for like 10 second and then it gives me this error 

```

源代码管理Merege向导

Source Control Merege Wizard

合并遇到0个错误和75个警告。

Merge encounterd 0 error(s) and 75 warning(s).

TF400959: $ $ .... .... node_modules / ..........的路径超出了目录的388个字符限制,或者目录和文件名的限制为399.

TF400959: the limit of 388 charecters for a directory, or 399 for a directory and file name, was exceeded by the path for `$/....node_modules/..........`

有关任何其他错误的信息,请参阅输出工具窗口。

See output tool windows for information on any other errors.

` ``

错误会产生完整的场景。然而,让我感到困惑的是  node_modules   在两个分支上都不存在
。此外,我删除了文件夹  node_modules  

The error makes complete scene. However, what is puzzling me is that the node_modules does not existing on either branch. Also, I removed the folder node_modules from my local projects.

我还应该注意  node_modules   使用
在TFS上,但几周前我使用changeset 20000从TFS中删除了它。但是,今天"在最新版本中"文件夹  node_modules   在TFS上不存在
。我还通过门户网站验证了同样的事情。

I should also note that node_modules use to be on TFS, but then I removed it from TFS few weeks ago using changeset 20000. But, today "in the latest version" the folder node_modules does not existing on TFS. I also validated the same thing via the web portal.

我试图通过删除此文件夹的内容来删除本地的TFS缓存  %localappdata%\ Microsoft \团队
Foundation \5.0 \ CA
  但问题仍然存在。

I tried to remove the TFS cache locally by deleting the content of this folder %localappdata%\Microsoft\Team Foundation\5.0\Cache but the issue still exists.

如何绕过此错误并正确合并这些更改?

How can I bypass this error and correctly merge these changes?

我尝试使用`/ discard`选项`tf merge`但没有帮助。这是我发出的命令。

I tried to use the `/discard` option with the `tf merge` but that did not help. This is the command I issued.

`tf merge" $ / ProjectA" $ / ProjectA-Dev / discard / recursive / version:C20000~20000`

推荐答案

MrMikeA,

Hi MrMikeA,

感谢您在此发帖。

根据错误消息,似乎node_modules仍然存在于您的项目中并影响合并。所以我建议您可以尝试获取两个分支的最新版本,然后尝试再次进行合并。实际上该文件不会在源代码管理中完全删除
,您可以选择工具>>选项>> Visual Studio Team Foundation Server>>在源代码管理资源管理器中显示已删除的项目。之后,您可以尝试使用destroy命令永久删除node_moduls:

According to the error message, it seems that the node_modules still exist in your project and affect the merge. So I suggest that you could try to get latest version of both branches, then try to do the merge again. And actually the file will not be deleted completely in source control, you could select the Tools>>Options>>Visual Studio Team Foundation Server>>Show deleted items in source control explorer. After that you could try to use the destroy command to delete the node_moduls permanently:

https://www.visualstudio.com/en-us/docs/tfvc/destroy-command-team-foundation-version-control

最后检查是否可以在源代码管理浏览器中找到该文件并再次检查结果。

Finally check if you could find the file in source control explorer and check the result again.

最好的问候

Limitxiao Gao

Limitxiao Gao


这篇关于如何使用Visual Studio 2013在TFS中正确合并两个分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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