TFS How to change the computer name or owner for a workspace

The owner and computer name of the workspace are not editable in Visual Studio 2010. However, you might need it when you renamed your machine or your account is renamed. To do this, open a Visual Studio Command Prompt (2010) from program files, and cd to your workspace, then run following

Change the computer name for a workspace

tf workspaces /updateComputerName:<OldComputerName> /collection:<CollectionURL>

You need replace <OldComputerName> to your actual old computer name and <CollectionURL> to your actual TFS collection URL.

Change the owner for a workspace

tf workspaces /updateUserName:<OldUserName> /collection:<CollectionURL>

Common TFS commands

tf.exe is Team Foundation source control command-line tool which can be used to perform source control operations without GUI interaction. Here are some common tf commands I use in my daily work. You can run command tf /? to view more or visit MSDN TF Command Line Tool Reference

Common tf commands

sync Sync files under current folder tf get
Sync files under current folder and all sub folders tf get . /r
Sync file to a given revision tf get <filename>;<revision>
Display what would be synced tf get /preview
Force sync tf get /all
Force sync, will override existing files tf get /force
add Add new file tf add <filename>
checkout Checkout file for editing tf checkout <filename>
delete Delete file tf delete <filename>
rename Rename file tf rename
checkin Submit open files to tfs server tf checkin
resolve Resolve file conflicts tf resolve
Resolve file with automatical merge tf resolve /i /auto:acceptmerge>
shelve Package pending change and store to tfs server tf shelve <shelvesetname>
unshelve Unpackage shelve from tfs server into current workspace tf unshelve <shelvesetname>
workspace Update workspace configurations tf workspace <workspacename>

Common tfpt commands

tftp.exe is a command line tool that you can use to work with files and directories under version control, team projects, and work items. Some commands display a graphical user interface when run. tfpt.exe is part of Team Foundation Server Power Tools which can be downloaded here.

Revert unchanged files tfpt uu /noget
Search all modified files not in source control and add to pending change list tfpt online
Scorch – Remove all files in local workspaces but not in source control tfpt treeclean -delete
Undo submitted change tfpt undo
View difference of a shelve tfpt review /shelveset