Reputation: 9959
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?
Upvotes: 1
Views: 1427
Reputation: 1148
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.
- From the Source Control Explorer find the folder containing the locked file(s).
- Right-click and select Find then Find by Status...
- The "Find in Source Control" window appears
- Click the Find button
- A "Find in Source Control" tab should appear showing the file(s) that are checked out
- Right click the file you want to unlock
- Select Undo... from the context menu
- A confirmation dialog appears. Click the Yes button.
- The file should disappear from the "Find in Source Control" window.
The file is now unlocked.
Upvotes: 0
Reputation: 4156
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
Upvotes: 5