A personal repository of technical notes. - CSC

TFS Team Foundation Server Command Line Tips

How to get all items checked out to user
tf status /user:myusername /format:Detailed

How to get all items checked out to all users in a specific source location
tf status /user:* /recursive "$/My Folder1/My Folder2"

Variation: Pipe the results to the FIND command in order to filter the results. This example shows only items of change type "add".
tf status /user:* /recursive "$/My Folder1/My Folder2" | FIND " add "

How to undo other user's checkout.
Step 1) Get workspace and user name of checked out file.
tf status /user:* /format:detailed "$/My Folder1/My File1.txt"

Step 2) Undo checked out file.
tf undo /workspace:myworkspace;myusername "$/My Folder1/My File1.txt"

References
"Status Command." MSDN | Microsoft Development, Subscriptions, Resources, and More. Web. 16 Aug. 2010.
<http://msdn.microsoft.com/en-us/library/9s5ae285(v=VS.90).aspx>.
"Undo Command." MSDN | Microsoft Development, Subscriptions, Resources, and More. Web. 16 Aug. 2010.
<http://msdn.microsoft.com/en-us/library/c72skhw4(v=VS.90).aspx>.
"Command-Line Syntax (Team System)." MSDN | Microsoft Development, Subscriptions, Resources, and More. Web. 23 Sept. 2010.
<http://msdn.microsoft.com/en-us/library/56f7w6be(v=VS.90).aspx>.

Updates
2010-09-23 Added "Get items checked out to all users in a specific source location"; reference to "Command-Line Syntax (Team System)."
2010-09-24 Added "Variation: Pipe the results to the FIND command..."

No comments:

Post a Comment