How to get the list of currently checked out files in TFS?

If you are wondering about what files are currently checked out in specific project in TFS, there is a command line statement in TFS you can run to fetch list of files checked out by specific user or all user.

tf.exe status $/[PROJECTNAME] /user:* /s:http://[TFS SERVER NAME]:[PORT] /recursive

For example,

tf.exe status $/DevProject /user:shailp /s:http:/tfsdev/:8080

This will return all files that are checked by user ‘shailp’ under project ‘DevProject’.

tf.exe status $/DevProject /user:* /s:http://tfsdev:8080

This will return all checked-out files under project ‘DevProject’.

If you want to rename the branch or move branch, you CAN”T do this operation if some files are checked out by someone.  So above command will help you to see what files are checked out by who.  If you have an administrative rights on TFS server, you can undo checked out or check in  changes that some one is currently working on that..

Here is the command how to undo check out some one’s changes

tf undo [/workspace:workspacename[;workspaceowner]] [/server:servername] [/recursive] itemspec

For Example,

tf undo /workspace:Dev-Main;shailp /server:http://tfsdev:8080 $/DevProject/Dev/Main/Admin/Test.aspx

This will undo the changes ‘shailp'(user) made in Test.aspx file. Dev-Main is ‘shailp’ workspace.

If you have any question, leave a comment here.  If this post really helps you, please click the Google +1 button to show it really helps you save your time.

Posted in Microsoft Technology Tagged with:
3 comments on “How to get the list of currently checked out files in TFS?
  1. xster says:

    TFS Power Tools are far easier to use with integration in VS and free
    http://msdn.microsoft.com/en-us/vstudio/bb980963.aspx

  2. Shailesh says:

    @xster, That’s true you can use power tools. But some time you may be in the situation that you might need to take permission to install any kind of software in your computer or can’t install for some reason or some one is command line savvy. But if we have power tools installed, it’s really easy to use. I agree

  3. Terry says:

    Power tools does allow me to see the files checked out. Is there any way to get a date of when the files were checked out?

Ads