Friday, June 20, 2008

How to delete workspace from TFS (Team Foundation Server)?

Now its long time I’m working on TFS, everyday leaning something new as it’s creates new problem for me. (It’s really a sweet product, but only if you are good in command prompts use and expert to use TFS)

Yesterday due to some locking and conflict issues I need to delete a workspace on one machine. Initially I was searching Visual studio for any option to delete it something like Right click delete optionJ, unfortunately there is no option like this; I don’t understand why Microsoft is not providing nice GUI interface for TFS management just like other Microsoft servers. Command prompt is only way to do any TFS management related operations.

Ok so next problem is- the command to delete or unlock the workspace?
Some MSDN and Google search solves the problem. Here are the TFS commands which you can use on “Visual studio Command prompt”

List the Workspace names, owners etc

  • tf workspaces /server: ServerName /owner:*
  • tf workspaces /server: ServerName /owner: OwnerName

Delete the workspace

  • tf workspace /server: ServerName /delete WorkspaceName

Remember after deleting workspace you can not recover it…
you can find more workspace related commands at