TFS 2012 取消搁置到不同的分支 ->已添加具有相同键的项目 [英] TFS 2012 Unshelve to different branch -> An item with the same key has already been added
问题描述
我需要帮助解决以下问题:
I need help resolving the following issue:
我正在尝试将源分支中的代码搁置到目标分支上.
I am attempting to unshelve code from the source branch onto a target branch.
我正在使用以下内容:
- VS2012 RC
- TFS 2012
- VS2012 x64 跨工具命令提示符
当我使用命令提示符执行取消搁置操作时,出现以下情况:
When I use the command prompt to perform the unshelve operation, the following occurs:
- 显示包含更改文件列表的货架集详细信息对话框.
- 点击取消搁置按钮.
- 观察命令提示符输出:已添加具有相同键的项目."
我已经下载了电动工具的 ServicePack1.但是,我未能解决此问题.
I have downloaded ServicePack1 for power tools. However, I have failed to resolve this issue.
推荐答案
我在使用 Visual Studio 2013 和以下命令时遇到了同样的错误:
I had the same error when using Visual Studio 2013 and the following command:
> tfpt unshelve /migrate /source:"$/Root/Solution" /target:"$/Root/Branches/Solution" "The name of my shelveset"
> An item with the same key has already been added
研究
这是我试图解决的问题:
Here's what I tried to fix the issue:
- 按照 Andrey 的回答清除缓存
- 尝试从 Source -> Branch 和 Branch -> Source 运行命令
- 我的工作区已经包含源分支和目标分支
解决方案
打开相当于 VS2013 x86 Native Tools 命令提示符的窗口.
Open up your equivalent of the VS2013 x86 Native Tools Command Prompt.
检查您是否安装了 Team Foundation Power Tools:
Check you have Team Foundation Power Tools installed:
C:Program Files (x86)Microsoft Visual Studio 12.0VC fpt
C:Program Files (x86)Microsoft Visual Studio 12.0VC fpt
确保您有 0 个待处理和已排除更改.
我有一些已检测到但未添加的已排除更改,这就是让我感到惊讶的原因.排除的更改应如下所示:
注意:没有检测到:XX(添加)" - 应该不可见
Ensure you have 0 Pending and Excluded changes.
I had some Excluded changes which were detected but not added and this is what caught me out. Excluded changes should look like this:
Note: No "Detected: XX (adds)" - should not be visible
当您运行 tf status
时,您应该会看到如下所示的内容.
.tfignore 文件的 1 个更改或 0 个更改.其他任何事情都会破坏合并.
When you run tf status
, you should see something like the following.
Either 1 change(s) for the .tfignore file or 0 change(s). Anything else will upset the merge.
C: fsRootSolution>tf 状态
文件名更改本地路径
C: fsRootSolution>tf status
File name Change Local path
$/Root .tfignore 编辑 C: fsRootSolution.tfignore
$/Root .tfignore edit C: fsRootSolution.tfignore
1 个更改
确保您正在从源解决方案目录运行 tfpt
命令
您现在应该能够成功地将搁置集从一个分支合并到另一个分支.
You should be now be able to successfully merge a shelveset from one branch to another.
关于 .tfsignore 的注意事项:
如果您有很多挂起的更改,无论出于何种原因都不想撤消,那么修改 .tfignore 文件就可以了.
如果这是您保留的唯一更改文件,则不会停止合并.
.tfignore 参考 => stackoverflow - 如何忽略 tfs 中的文件/目录?一个>
这篇关于TFS 2012 取消搁置到不同的分支 ->已添加具有相同键的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!