TFS 服务器签入错误 - 找不到文件 - 服务器相关和命令行 [英] TFS Server checkin error - could not find file - Server Related and Command Line
问题描述
这与问题有关,
完全避免问题
为了完全避免这个问题,您有几个选择.您可以切换到本地工作区,而不是服务器工作区.那些自动检测本地更改并且不会在 TFS 服务器本身上注册更改.阅读有关本地工作区的更多信息.
您可以从 tf vc
命令行执行删除操作,而无需使用其他工具来删除文件和文件夹,例如:
tf vc delete $/project/path/to/file
delete
命令也有一个 /recursive
选项.使用此命令不仅会更新您的本地文件夹,还会更新服务器工作区.
This relates to question,
TFS checkin error - could not find file
"When checking in my project I get the error:
Could not find file 'C\blah blah blah'.
I have a feeling this might be a file from an old project I deleted.
I have tried deleting my TFS connection and workspaces.
The Solution was:
This will happen when TFS has some changes staged that no longer exist on the file system. For instance, if you add some files in Visual Studio (which adds them to the changes list), delete them directly from the file system, then attempt to check in the changes, it will complain that it could not find the file(s).
To remove these changes from the list, you can open Source Control Explorer (View > Other Windows > Source Control Explorer) and either Delete the nonexistent files or right-click on the offending files and Undo Pending Changes.
You can also undo these specific changes from the Pending Changes panel in Team Explorer.
Follow up Question:
So my question is, how do I conduct the equivalent of this in the TFS Server? It continuously happens multiple times on our team. This works on a person's desktop, but whats the equivalent commandline in the TFS server, and can I incorporate this in my build steps?
You can undo another person's changes from the commandline using:
tf vc undo /workspace:workspacename;owner $/project/path/to/file
You can get this information by calling:
tf vc status $/project/path/to/file /user:*
This allows you to remove pending changes from the server, though it won't cause the files to be reverted on the workstation of the developer in question.
Both commands offer a /recursive
option to undo multiple files under a specific path at once.
If you're using Visual Studio 2015 or earlier, then you can use the TFS Power Tools to add a "Find by status" option to the Visual Studio Source Control Explorer. This has unfortunately not made it into Visual Studio 2017 and there are no TFS Power Tools for Visual Studio 2017.
The TFS Sidekicks offer a Status Sidekick screen, which allows you to query all files currently checked out for edit in server workspaces and allow you to undo them centrally.
Preventing the issue altogether
To prevent the issue altogether you have a few options. You can switch to Local workspaces, instead of server workspaces. Those auto-detect local changes and don't register changes on the TFS server itself. Read more about local workspaces.
You can perform the deletes from the tf vc
command line instead of using other tools to delete files and folders, for example:
tf vc delete $/project/path/to/file
The delete
command also has a /recursive
option. Using this command will not only update your local folder, but will also update the server workspace.
这篇关于TFS 服务器签入错误 - 找不到文件 - 服务器相关和命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!