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:
- 按照安德烈的回答清除缓存
- 尝试从 Source->分支和 Branch-> Source 运行命令
- 我的工作区已经包含源分支和目标分支
- Clearing the Cache as per Andrey's answer
- Try running the command from the Source -> Branch and Branch -> Source
- My workspace already encompassed both source and target branches
解决方案
打开与VS2013 x86本机工具命令提示符相对应的内容.
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.0 \ VC \ tfpt
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\tfpt
确保您进行了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:\ tfs \ Root \ Solution> tf状态
文件名更改本地路径
C:\tfs\Root\Solution>tf status
File name Change Local path
$/Root .tfignore编辑C:\ tfs \ Root \ Solution.tfignore
$/Root .tfignore edit C:\tfs\Root\Solution.tfignore
1次更改
确保您正在源解决方案目录中运行tfpt
命令
您现在应该能够成功地将一个货架集从一个分支合并到另一个分支.
You should be now be able to successfully merge a shelveset from one branch to another.
.tfsignore的注意事项:
如果您有许多未决的更改,无论出于何种原因都不想撤消,那么
可以对.tfignore文件进行修改.
如果这是唯一留下的更改文件,则不会阻止合并.
.tfignore参考=> stackoverflow-如何忽略tfs中的文件/目录?
Note on .tfsignore:
If you have a lot of pending changes that you don't want to undo for whatever reason, then
a modification to the .tfignore file is ok.
If this is the only file that you have left with changes, it won't brake the merge.
.tfignore reference => stackoverflow - How to ignore files/directories in tfs?
这篇关于TFS 2012搁置到其他分支->具有相同键的项目已被添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!