[英]How to bypass TFS error regarding character path limits for directories that have been removed? (Visual Studio 2013)
I am using TFS to source control my c# ASP.NET MVC projects.我正在使用 TFS 来控制我的 c# ASP.NET MVC 项目。 I have a project called
ProjectA
, It has two branches (ie ProjectA
and ProjectA-Dev
.) ProjectA
is my production branch, and ProjectA-Dev
is my development branch.我有一个名为
ProjectA
,它有两个分支(即ProjectA
和ProjectA-Dev
。) ProjectA
是我的生产分支,而ProjectA-Dev
是我的开发分支。 ProjectA-Dev
contains lots of new code for my project's upcoming release. ProjectA-Dev
包含许多用于我的项目即将发布的新代码。
I am at a stage that I need to merge any change from production into dev.我正处于需要将生产中的任何更改合并到开发中的阶段。 My production version received a few bug fixes while I was working on my next release in
ProjectA-Dev
.当我在
ProjectA-Dev
处理我的下一个版本时,我的生产版本收到了一些错误修复。 I want to merge the added bug fixes into my ProjectA-Dev
branch.我想将添加的错误修复合并到我的
ProjectA-Dev
分支中。
To merge ProjectA
into ProjectA-dev
, I opened "Solution Control Explorer", right clicked on ProjectA
then on "Branching and Merging" then on "Merge".要将
ProjectA
合并到ProjectA-dev
,我打开了“解决方案控制资源管理器”,右键单击ProjectA
然后单击“分支和合并”,然后单击“合并”。
On the Source Control Merge Wizard I selected $/TFS/ProjectA
in the source branch.在源代码管理合并向导中,我在源分支中选择了
$/TFS/ProjectA
。 I then selected $/TFS/ProjectA-Dev
in the target branch.然后我在目标分支中选择了
$/TFS/ProjectA-Dev
。 Then I hit "Next", selected "Latest Version", and hit "Finish".然后我点击“下一步”,选择“最新版本”,然后点击“完成”。
The process runs for approximately 10 seconds and then it gives me this error该过程运行了大约 10 秒,然后它给了我这个错误
The error makes complete sense.该错误完全有道理。 However, what is puzzling me is that the
node_modules
directory does not exist on either branch.然而,令我困惑的是
node_modules
目录在任何一个分支上都不存在。 Also, I removed the folder node_modules
from my local projects.此外,我从本地项目中删除了文件夹
node_modules
。
I should also note that node_modules
used to be in 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 exist on TFS.我还应该注意到
node_modules
曾经在 TFS 中,但几周前我使用变更集 20000 从 TFS 中删除了它。但是,今天,在最新版本中,文件夹node_modules
在 TFS 上不存在。 I also validated the same thing via the web portal.我还通过门户网站验证了同样的事情。
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.我尝试通过删除此文件夹
%localappdata%\\Microsoft\\Team Foundation\\5.0\\Cache
的内容来在本地删除 TFS 缓存,但问题仍然存在。
How can I bypass this error and correctly merge these changes?如何绕过此错误并正确合并这些更改?
运行tf destroy "$/MyPath/To/Project/node_module"
后,我终于让它工作了
TFS might not know what you changed (deleted node_modules files) and if the change might be relevant to the branch during a long changesets in branch projectA. TFS 可能不知道您更改了什么(已删除的 node_modules 文件),以及在分支项目 A 中的长更改集期间更改是否可能与分支相关。
You could find the specific changeset which you deleted the node_modules files first.您可以找到首先删除 node_modules 文件的特定变更集。 Then just use tf merge command with
/discard
option.然后只需使用带有
/discard
选项的tf merge 命令。
/discard Does not perform the merge operation, but updates the merge history to track that the merge occurred.
/discard不执行合并操作,但更新合并历史记录以跟踪合并发生。 This discards a changeset from being used for a particular merge.
这会丢弃用于特定合并的变更集。
Sample command:示例命令:
tf merge $/Project/SourceBranch $/Project/TargetBranch /discard /recursive /version:C56693~C56693
It discards changeset 56693. The version is a from ~ to, so you can discard multiple changesets at once.它丢弃变更集 56693。版本是从 ~ 到,因此您可以一次丢弃多个变更集。 In your case discard the changeset till the specific changeset node_modules files deleted.
在您的情况下,丢弃变更集,直到删除特定的变更集 node_modules 文件。 When the command has finished, you still need to check in the merge .
命令完成后,您仍然需要签入 merge 。
After this just perform the normal merge action again.在此之后只需再次执行正常的合并操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.