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

发布于 2024-07-16 22:38:34 字数 387 浏览 7 评论 0原文

我有一个永远丢失的工作空间。 我从这个工作区签出了一些文件。 我想解锁它们,但我不能。 我试图这样做:

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

但我收到了这条消息:

工作区丢失;用户不在该工作区 电脑。 运行 get (获取所有如果编辑 已撤消)在托管计算机上 该工作区以更新它 已做出的更改 服务器。

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

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.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陈甜 2024-07-23 22:38:34

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

tf workspace /delete WorkspaceName;WorkspaceOwner

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
岁月如刀 2024-07-23 22:38:34

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

复制答案以方便参考:

(注意:我安装了 TFS Power Tools,因此如果您没有看到
描述了您可能需要安装它们的选项。
http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084- 4cb8-9bc7-06c3bad9148f

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

  1. 从源代码管理资源管理器中找到包含锁定文件的文件夹。
  2. 右键单击并选择查找,然后选择按状态查找...
  3. 出现“在源代码管理中查找”窗口
  4. 点击查找按钮
  5. 应出现“在源代码管理中查找”选项卡,显示已签出的文件
  6. 右键点击您要解锁的文件
  7. 从上下文菜单中选择撤消...
  8. 出现确认对话框。 点击按钮。
  9. 该文件应该从“在源代码管理中查找”窗口中消失。

文件现已解锁。

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

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
)

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.

  1. From the Source Control Explorer find the folder containing the locked file(s).
  2. Right-click and select Find then Find by Status...
  3. The "Find in Source Control" window appears
  4. Click the Find button
  5. A "Find in Source Control" tab should appear showing the file(s) that are checked out
  6. Right click the file you want to unlock
  7. Select Undo... from the context menu
  8. A confirmation dialog appears. Click the Yes button.
  9. The file should disappear from the "Find in Source Control" window.

The file is now unlocked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文