I am working on a server of which TFS 2012 was installed. Other than TFS 2012, there is also Visual studio 2010 and Visual Studio 2012 in the server. I would like to know if there is any way I can get a list of the work space in the local directory on that server?
What I want to do is, I want to run batch job which uses TF.exe to retrieve the latest sources code from TFS and put them into a directory. However, when I run the TF.exe command, I always got an error message "Unable to determine the source control server".
I research on the internet and I saw that I need to create workspace and mapped the workspace into a local directory, and then I can run TF.exe on that mapped directory.
Actually, I can create a new workspace and do a new mapping on my own. But I am afraid doing so may affect some existing setting (for I am completely new to TFS, I don't know what will be the impact be for adding new workspace and new mapping). So it would be much better if I can see if there are any existing workspace/mapping in that server.
Could anyone please help, or give me your advice under my scenario?
TFS workspaces are unique to your user name and the remote computer name and workspace information is stored both on your local computer and on the server. Genearlly if the machine name not changed, the previous workspace will be still available when you connect to the team project.
A "workspace" in TFS defines where the code resides locally. In essence, a workspace is a folder, or multiple folders, mapped to areas in TFS. When code is checked out of TFS, the code is stored locally based off your workspace mappings.
To make the current directory a working folder for an existing workspace on your computer, type tf workspace workspacename, where workspacename is the name of the existing workspace. The Edit Workspace dialog box appears.
To do this from the command line then you can use
tf workspaces /owner:* /computer:COMPUTERNAME /collection:http://TFSSERVER:8080/tfs/COLLECTIONNAME
This will list all of the workspaces on the machine.
You can then use the workfold command to understand the mappings.
tf workfold /workspace:WORKSPACENAME /collection:http://TFSSERVER:8080/tfs/COLLECTIONNAME
Alternatively download TFS sidekicks and use the workspace sidekick to query the server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With