从解决方案资源管理器中删除解决方案文件夹中保留在 TFS 中的团队中的文件夹

Deleting folders in a Solution Folder that remain across a team in TFS after removing them from Solution Explorer

在整个团队中使用 TFS 时,是否可以删除已从解决方案资源管理器中删除的 Web 项目文件夹或库文件夹(仍保留在解决方案文件夹中)而无需手动执行?

我发现我和团队成员必须交叉检查解决方案的文件夹,因为即使这些文件已从解决方案资源管理器中删除,这些文件仍 "housed" 在解决方案文件夹中。 (绑定有效且受源代码控制)

在此先感谢您的帮助

通常您需要在从解决方案资源管理器中删除 folders/files 后签入更改,然后其他团队成员获取最新版本(Right-click --> 获取最新版本)以同步文件TFS 服务器。

If you are deleting a file from Solution Explorer, the following warning message may appear: will be deleted permanently. The file deletion will not be implemented on the server until you check in this change. If the file was checked in to version control before the delete, then you can recover the file. Choose OK if you want to proceed with deleting the file.

详情请见Delete an item

注意 默认情况下,已删除的 folders/files 在源代码管理资源管理器中被标记为已删除(带有 X )。要在 SCE 中隐藏已删除的项目,请转到工具->选项->源代码管理->Visual Studio Team Foundation Server 和 取消标记Show deleted items in Source Control Explorer”。


更新:

只需尝试以下步骤即可删除 TFS 中的文件夹:

  1. 获取文件夹的最新源代码(文件夹上的Right-click --> 获取最新版本)
  2. 从源代码管理资源管理器或解决方案资源管理器中删除文件夹
  3. 检查您的更改(如果仍然无效,请尝试创建一个新的工作区,然后重试。)

请注意,删除并不是真正的删除,folders/files 仍然存在并保存在版本控制中。要从 TFS 中永久删除,您需要发出 tfs destroy 命令:

为此:

  1. 打开 Visual Studio 命令提示符。
  2. 发出以下命令:tf destroy $/SourceLocation/Folder。 其中 $/SourceLocation/Folder 是 已删除 TFS 中的文件夹。

详情见Destroy Command