且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

TFS 服务器签入错误 - 找不到文件 - 服务器相关和命令行

更新时间:2023-08-21 10:16:10

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.