如何撤消来自非托管工作空间的tfs中的更改?

时间:2023-01-24 13:56:17

I have a workspace that is lost forever. I have some files checked out from this workspace. I want to unlock them but I can't. I tried to do:

我有一个永远失去的工作空间。我从这个工作区检出了一些文件。我想解锁他们,但我不能。我试着做:

TF UNDO $/MyProject/MyFolder/MyFile.cs /WORKSPACE:LOST;user /s:http://mysite:8080

But I got this message:

但是我得到了这样的信息:

The workspace LOST;user is not on this computer. Run get (get all if edits were undone) on the computer hosting that workspace to update it with the change s that have been made on the server.

工作区LOST;用户不在此计算机上。在托管该工作区的计算机上运行get(如果撤消编辑,则获取所有内容),以使用在服务器上进行的更改来更新它。

Does exist any way to undo a file (not every file) checked out by unavailable workspace?

是否存在撤消由不可用工作区签出的文件(不是每个文件)的任何方法?

2 个解决方案

#1


If the workspace is lost, then I would just delete it. Deleting it undoes any changes that were made in it.

如果工作区丢失了,那我就删除它。删除它会撤消在其中所做的任何更改。

tf workspace /delete WorkspaceName;WorkspaceOwner

#2


As long as you have the appropiate permissions I would think that the method from this answer by @BubbleSort should work: https://*.com/a/17870318/1982894 He used TFS 2012, I have tested it in TFS 2010 and it works there too.

只要你有合适的权限,我认为@BubbleSort的答案中的方法应该有效:https://*.com/a/17870318/1982894他使用了TFS 2012,我在TFS 2010中测试了它,它也在那里工作。

Answer copied for easy reference:

复制答案以方便参考:

(Note: I have the TFS Power Tools installed so if you don't see the described options you may need to install them. http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f )

(注意:我安装了TFS电动工具,如果您没有看到所描述的选项,则可能需要安装它们.http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f)

If you are accessing the Source Control Explorer as a team project administrator (or at least someone with the "Undo other users' changes" access right) you can do the following in Visual Studio 2012 to clear a lock and checkout.

如果您以团队项目管理员(或至少具有“撤消其他用户更改”访问权限的人)访问源代码管理资源管理器,则可以在Visual Studio 2012中执行以下操作以清除锁定和签出。

  1. From the Source Control Explorer find the folder containing the locked file(s).
  2. 从Source Control Explorer中找到包含锁定文件的文件夹。

  3. Right-click and select Find then Find by Status...
  4. 右键单击并选择查找然后按状态查找...

  5. The "Find in Source Control" window appears
  6. 将出现“在源代码管理中查找”窗口

  7. Click the Find button
  8. 单击“查找”按钮

  9. A "Find in Source Control" tab should appear showing the file(s) that are checked out
  10. 将出现“在源代码管理中查找”选项卡,显示已签出的文件

  11. Right click the file you want to unlock
  12. 右键单击要解锁的文件

  13. Select Undo... from the context menu
  14. 从上下文菜单中选择“撤消...”

  15. A confirmation dialog appears. Click the Yes button.
  16. 出现确认对话框。单击是按钮。

  17. The file should disappear from the "Find in Source Control" window.
  18. 该文件应从“在源代码管理中查找”窗口中消失。

The file is now unlocked.

该文件现已解锁。

#1


If the workspace is lost, then I would just delete it. Deleting it undoes any changes that were made in it.

如果工作区丢失了,那我就删除它。删除它会撤消在其中所做的任何更改。

tf workspace /delete WorkspaceName;WorkspaceOwner

#2


As long as you have the appropiate permissions I would think that the method from this answer by @BubbleSort should work: https://*.com/a/17870318/1982894 He used TFS 2012, I have tested it in TFS 2010 and it works there too.

只要你有合适的权限,我认为@BubbleSort的答案中的方法应该有效:https://*.com/a/17870318/1982894他使用了TFS 2012,我在TFS 2010中测试了它,它也在那里工作。

Answer copied for easy reference:

复制答案以方便参考:

(Note: I have the TFS Power Tools installed so if you don't see the described options you may need to install them. http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f )

(注意:我安装了TFS电动工具,如果您没有看到所描述的选项,则可能需要安装它们.http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f)

If you are accessing the Source Control Explorer as a team project administrator (or at least someone with the "Undo other users' changes" access right) you can do the following in Visual Studio 2012 to clear a lock and checkout.

如果您以团队项目管理员(或至少具有“撤消其他用户更改”访问权限的人)访问源代码管理资源管理器,则可以在Visual Studio 2012中执行以下操作以清除锁定和签出。

  1. From the Source Control Explorer find the folder containing the locked file(s).
  2. 从Source Control Explorer中找到包含锁定文件的文件夹。

  3. Right-click and select Find then Find by Status...
  4. 右键单击并选择查找然后按状态查找...

  5. The "Find in Source Control" window appears
  6. 将出现“在源代码管理中查找”窗口

  7. Click the Find button
  8. 单击“查找”按钮

  9. A "Find in Source Control" tab should appear showing the file(s) that are checked out
  10. 将出现“在源代码管理中查找”选项卡,显示已签出的文件

  11. Right click the file you want to unlock
  12. 右键单击要解锁的文件

  13. Select Undo... from the context menu
  14. 从上下文菜单中选择“撤消...”

  15. A confirmation dialog appears. Click the Yes button.
  16. 出现确认对话框。单击是按钮。

  17. The file should disappear from the "Find in Source Control" window.
  18. 该文件应从“在源代码管理中查找”窗口中消失。

The file is now unlocked.

该文件现已解锁。