使用 Tfs 2015,在我的 dev 文件夹中运行以下命令时:
tfpt uu\noget\递归
它告诉我:
没有多余的挂起更改,尽管在我的工作区中有 15 个文件处于挂起更改中,但根本没有更改。
有谁知道什么命令对我不起作用?
最佳答案
特别是关于您的示例场景 - 一个怪癖是在你的例子中你的斜杠的方向你使用反斜杠而不是正斜杠没有按预期工作。
我专门测试了您的场景,并且可以在尝试以下情况时使用反斜杠模拟您的结果。
编辑:测试结果操作场景
Visual Studio 2015 企业版(版本:14.0.23107.0 D14REL)
TFS Powertools 2015(版本 14.0.23206.0)
D:\src\testapp\src1>tfpt uu /recursive /noget Getting the list of pending changes for your workspace... Building the list of redundant changes... edit (contents match): d:\src\testapp\src1\file_with_pending_change.txt Do you wish to undo these redundant pending changes? (Y/N) n Operation canceled.
D:\src\testapp\src1>tfpt uu \recursive \noget Bringing the specified items up to the latest version… Getting the list of pending changes for your workspace... There are no redundant pending changes.
D:\src\testapp\src1>tfpt uu /recursive /noget Getting the list of pending changes for your workspace... Building the list of redundant changes... edit (contents match): d:\src\testapp\src1\file_with_pending_change.txt Do you wish to undo these redundant pending changes? (Y/N) y Undoing redundant changes... edit: file_with_pending_change.txt 1 changes undone.
编辑 2:操作问题..
在对此答案的评论中,我建议 OP 删除 TFS 缓存以便从已知的基线状态开始,因为在测试了我的解决方案并没有得到预期的结果后,这似乎确实是一个损坏的工作区状态问题。
可以通过关闭IDE并删除其中的文件来删除缓存
C:\Users\USERNAME\AppData\Local\Microsoft\Team Foundation\XXXX\Cache
然后再次打开 IDE 并检查是否仍然出现ghost 挂起更改。在挂起的更改仍然出现的情况下,我建议搁置或提交想要保留的更改并删除工作区。
关于 TFPT 的附加说明:
如果 tfpt 工作路径不在映射的工作区路径中,则 tfpt 命令将导致指定的消息 -
例子:
我有一个名为的服务器路径:
$/serverpath/testapp/src1
我将该路径映射到本地:
D:\src\testapp\src1
模拟我然后显式 check out 中的文本文件src1 用于编辑。
tfpt uu/recursive/noget 执行自 D:\src\testapp 结果是
Bringing the specified items up to the latest version...
Getting the list of pending changes for your workspace...
There are no redundant pending changes.
tfpt uu/recursive/noget 执行自 D:\src\testapp\src1 结果是
Getting the list of pending changes for your workspace...
Building the list of redundant changes...
edit (contents match): d:\src\testapp\src1\file_with_pending_change.txt
Do you wish to undo these redundant pending changes? (Y/N) y
Undoing redundant changes...
edit: file_with_pending_change.txt
1 changes undone.
相关说明:
您也可以运行标准的 TF 命令,尽管您将显式添加 TF.exe 执行的路径:
tf undo /recursive D:\src\testapp\src1
这导致:
Undoing edit: file_with_pending_change.txt
关于tfs - 在 Tfs 电动工具不起作用的情况下撤消未更改的待定更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35948707/