How to update TFS workspace after computer name ch

2020-05-13 23:47发布

I renamed my computer name, and now my TFS workspace is broken in Visual Studio 2012.

When I type:

tf workspaces /computer:ABOTONJIC-PC /owner:* /format:detailed

Workspace  : ABOTONJIC-PC
Owner      : wrongowner@test.com
Computer   : ABOTONJIC-PC
Comment    :
Collection : netuse.visualstudio.com\DefaultCollection
Permissions: Private
Location   : Local
File Time  : Current

But I need to have :

Owner      : realowner@test.com
Computer   : NEW-PC

Then I try:

tf workspaces /updateComputerName:ABOTONJIC-PC /collection:netuse.visualstudio.com/DefaultCollection

No workspace matching *;wrongowner@test.com on computer NEW-PC found in Team Foundation Server netuse.visualstudio.com/DefaultCollection.

So my question are :

  1. How to update computer name in my workspace?
  2. Why TFS still shows "wrongowner@test.com" in workspace although there is new email registered as "realowner@test.com"?

11条回答
smile是对你的礼貌
2楼-- · 2020-05-14 00:26

Open the visual studio command prompt and type the following command

tf workspaces /updateComputerName:oldcomputername  /s:http://tfservername:port#/tfs

for example

tf workspaces /updateComputerName:abc-PC  /s:http://mytfsserver:8080/tfs

You can run the following command before and after running the above command, this is just to check the workspaces information on your computer.

Remember: run all these commands on client computer (which is renamed) and not on the computer where TFS server is installed.

If user name is also changed then run the following command

tf workspaces /updateUserName:oldUserName  /s:http://mytfsserver:8080/tfs

Hope it will help.

查看更多
萌系小妹纸
3楼-- · 2020-05-14 00:28
  1. Install Team Foundation Sidekicks. It's free.
  2. Open the Workspace Sidekick, click Search, and select your workspace from the list.
  3. Click the blue computer icon to Update Workspace Computer Name and you're done.
查看更多
【Aperson】
4楼-- · 2020-05-14 00:29

Open Command prompt and type as shown in below

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE

enter image description here

and type the following code with your credential

tf workspaces /updateComputerName:OldComputerName /s:"https://tfsServerName"

In CMD prompt

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>tf workspaces /updateComputerName:OldComputerName/s:"https://tfsServerName"

查看更多
够拽才男人
5楼-- · 2020-05-14 00:34

You can add new workspace then use vs 2017 delete your previous workspace: enter image description here

查看更多
放我归山
6楼-- · 2020-05-14 00:38

What worked for me was typing

tf workspaces /updateComputerName:MyOldComputerName /collection:"anything".visualstudios.com/DefaultCollection/
查看更多
登录 后发表回答