Wednesday, May 20, 2009

Useful Tf Command-Line Utility Commands

Tf Command line utility provide many useful operations that you can perform with Team Foundation Server. I am going to show you those ones which I used to use.

You can navigate the console here: Start / All Programs / Microsoft Visual Studio 2008 / Visual Studio Tools / Visual Studio 2008 x64 Win64 Command Prompt

Visual Studio 2005 and 2008
If you have both versions of VS installed, you need to add the TFS server to 'Team Explorer' on both of them, otherwise you would not be able to work with VS2005 projects from VS2008 console and vice versa. Also I recommend to use the same server aliace name on both of them. It would help you to avoid the situations when you have to add '/server:AnotherServerAliace' parameter while accessing VS2005 projects from VS2008 console and vice versa.

Common error: TF30076: The server name provided does not correspond to a server URI that can be found. Confirm that the server name is correct.


Working with project's environment
Here I demonstrate you 3 commands which you need to run under the project's root directory.

Watch who has uncommited and checkouted files for the project AxCMS_Sample
C:\Projects\AxCMS_Sample> tf status . /recursive /user:*

Get list of all the commities for user Bogdanov in AxCMS_Sample project
C:\Projects\AxCMS_Sample>tf history . /recursive /user:Bogdanov

Do 'get latest' for the project AxCMS_Sample
C:\Projects\AxCMS_Xtopia>tf get . /recursive


Working with workspaces
It is very often needed to install the solution to other (tester's or designer's) computer and it is very necessary not to mix workspaces otherwise when you logoff after successful installation - no one should be able to work with that solution (in VS2005/2008) on that machine - only you. Because solution is being associated with current machine and user who installed it. This information is named as "workspace" and stored into TFS server and will not allow anybody except you to work with that solution on that machine.

Common error: The working folder 'C:\Projects' already in use by the workspace 'MITCHELL;AXINOM\krolov' on computer 'MITCHELL'. Where MITCHELL is computer name and AXINOM\krolov or krolov is user.

Get the list of workspaces for user Bogdanov on all the computers
tf workspaces /owner:bogdanov

Open the workspace for editing
tf workspace lessing;bogdanov

Delete the unneeded workspace
tf workspace /delete ogawa;bogdanov


More about Tf Command-Line Utility Commands:
http://msdn.microsoft.com/en-us/library/z51z7zy0(VS.80).aspx

No comments:

Post a Comment