Thursday, March 4, 2010

Force Checkin files TFS 2005

tf lock $/MyProject/MyPath/MyFile.cs /lock:none /workspacename:WorkSpaceName /server:my_server

There is also an Undo command. It would get rid of any pending changes that the developer had made and they will lose any work they were doing. The syntax for Undo is:-

tf undo /workspacename:WorkSpaceName;dev_username /server:my_server $/MyProject/MyPath/MyFile.cs

We had a developer leave our company with some files still checked out when we were running on Beta 2. To find out which workspaces the developer had we used:-

tf workspaces /owner:dev_username /computer:* /server:my_server

Then we deleted them. Deleting the workspace also removes the lock on the files. The command to delete a workspace is:-

tf workspace /delete /server:your_tf_server workspacename;workspaceowner