Deleting Locked Workspace from Team Foundation Server

One thing I have noticed over the last year since I have started working with TFS is that it is highly sensitive to any changes/issues in the enviornment and easily gets currupted. However, TFS works wonderfully over the VPN connections far better than VSS. We initially struggled a lot on VSS while working remotely and it used to take a long time to check-in and would actually die if you were to take the latest of the whole project.

Anyway I got my solution corrupted due to some changes in the VPN settings in India Office, and was really stuck what to do about my already checked-out and locked files. I could restore the files one by one (they were only a few) but TFS got my old workspace locked and would’nt allow me to modify the files which are locked in the other workspace.

The solution is to unlock all files under a specific workspace and delete the old workspace. (This is only in case you are sure you can restore your changes manually). The Following TFS commands can be used

tf lock /lock:none /server:<server_name> /workspace:<my current workspace>;<domain>\<user> $/<project_name>

tf workspace /server:<server_name> /delete <my current workspace>;<domain>\<user>

If you do not know your workspace name or the previous user id you can list all tfs workspaces using the following.

tf workspaces /server:<server_name> /owner:*

Unfortunately, there are no options available in Visual Studio 2005 to do this, the workspace management option available in Visual Studio is extremely limited.


2 thoughts on “Deleting Locked Workspace from Team Foundation Server

  1. Pingback: » Deleting Locked Workspace from Team Foundation Server Cosmetics Tests: Just another WordPress weblog

  2. hey this comment is very much use full for the TFS workspaces’s really works.before getting this article i was really get fed up with managing the workspaces.thanks for this article.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s