在我的dev文件夹中运行以下命令时,使用Tfs 2015:
tfpt uu \ noget \ recursive
它告诉我:没有冗余的挂起更改,尽管在我的工作空间中有15个文件在挂起更改中,根本没有任何更改。
有谁知道该命令对我不起作用?
特别是关于您的示例场景 -一个怪癖是斜杠的方向,也就是在您的示例中您使用反斜杠而不是正斜杠无法按预期工作。
\n\n我专门测试了您的场景,并且可以在尝试以下情况时使用反斜杠来模拟您的结果。
\n\n编辑:测试结果OP场景
\n\nVisual Studio 2015 企业版(版本:14.0.23107.0 D14REL)
\n\nTFS Powertools 2015(版本 14.0.23206.0)
\n\n\n\n\nRun Code Online (Sandbox Code Playgroud)\nD:\\src\\testapp\\src1>tfpt uu /recursive /noget\nGetting the list of pending changes for your workspace...\nBuilding the list of redundant changes...\n edit (contents match): d:\\src\\testapp\\src1\\file_with_pending_change.txt\nDo you wish to undo these redundant pending changes? (Y/N) n\nOperation canceled.\n
\n\n\nRun Code Online (Sandbox Code Playgroud)\nD:\\src\\testapp\\src1>tfpt uu \\recursive \\noget\nBringing the specified items up to the latest version\xe2\x80\xa6\nGetting the list of pending changes for your workspace...\nThere are no redundant pending changes.\n
\n\n\nRun Code Online (Sandbox Code Playgroud)\nD:\\src\\testapp\\src1>tfpt uu /recursive /noget\nGetting the list of pending changes for your workspace...\nBuilding the list of redundant changes...\n edit (contents match): d:\\src\\testapp\\src1\\file_with_pending_change.txt\nDo you wish to undo these redundant pending changes? (Y/N) y\nUndoing redundant changes...\nedit: file_with_pending_change.txt\n1 changes undone.\n
编辑2:操作问题.. \n在这个答案的评论中,我建议OP删除TFS缓存,以便从已知的基线状态开始,因为在测试我的解决方案后,它并没有得到预期的结果,看来这确实是损坏的工作区状态问题。
\n\n删除缓存可以通过关闭IDE并删除其中的文件来完成
\n\nC:\\Users\\USERNAME\\AppData\\Local\\Microsoft\\Team Foundation\\XXXX\\Cache\nRun Code Online (Sandbox Code Playgroud)\n\n然后再次打开 IDE 并检查幽灵挂起的更改是否仍然出现。如果挂起的更改仍然出现,我建议搁置或提交想要保留的更改并删除工作区。
\n\n关于 TFPT 的附加说明: \n如果 tfpt工作路径不在映射的工作空间路径中,则 tfpt 命令将导致指定的消息 -
\n\n例子:
\n\n我有一个名为:的服务器路径:
\n\n\n\n\n$/serverpath/testapp/src1
\n
我将该路径本地映射到:
\n\n\n\n\nD:\\src\\testapp\\src1
\n
为了模拟,我然后显式地检查src1中的文本文件进行编辑。
\n\ntfpt uu /recursive /noget从D:\\src\\testapp执行结果为
\n\nBringing the specified items up to the latest version... \nGetting the list of pending changes for your workspace... \nThere are no redundant pending changes.\nRun Code Online (Sandbox Code Playgroud)\n\ntfpt uu /recursive /noget从D:\\src\\testapp\\src1执行结果为
\n\nGetting the list of pending changes for your workspace...\nBuilding the list of redundant changes...\n edit (contents match): d:\\src\\testapp\\src1\\file_with_pending_change.txt\nDo you wish to undo these redundant pending changes? (Y/N) y\nUndoing redundant changes... \nedit: file_with_pending_change.txt\n1 changes undone.\nRun Code Online (Sandbox Code Playgroud)\n\n相关说明:
\n\n您还可以运行标准 TF 命令,尽管您将显式添加 TF.exe 的执行路径:
\n\n\n\n\ntf undo /recursive D:\\src\\testapp\\src1
\n
结果是:
\n\nUndoing edit: file_with_pending_change.txt\nRun Code Online (Sandbox Code Playgroud)\n