计算机名称更改后如何更新TFS工作区?

52
我把电脑名称改了,现在我的Visual Studio 2012中的TFS工作区已经无法使用。
当我输入以下内容时:
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"?


1
可能是更改TFS工作区的计算机名称的重复问题。 - Edward Thomson
11个回答

49
  1. 安装免费的Team Foundation Sidekicks
  2. 打开Workspace Sidekick,点击搜索并从列表中选择您的工作区。
  3. 点击蓝色电脑图标以更新工作区计算机名称,然后完成。

有没有办法知道副应用正在执行哪个命令?我很好奇它使用的命令是什么...我似乎无法弄清楚需要使用哪个命令行选项来完成这个任务。 - Polaris878
1
这太重要了。谢谢。我正在向我的团队宣传。计算机名称更改是一个棘手的问题。 - sleath
1
对于Visual Studio 14或使用Windows 8.1+,无法正常运行。 - LKF
很棒的工具。一些非常有用的东西。 - Praxiom

49

我安装了Sidekicks,但它对于这个问题没有用,但是下面的方法有效:

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

1
你需要在服务器名称中使用https而不是http才能使其正常工作。由于编辑至少需要六个字符,因此它不允许我编辑帖子,这在讨论编程和代码行时真的很愚蠢。 - jaredbaszler
7
为了使用 /s 部分,我需要输入 http://servername:8080/tfs/projectcollectionname,其中替换成我的服务器名和项目集合名称。 - pseudocoder

32

我遇到了相同的问题,也有一个VisualStudio.com账户。

我尝试了提示中告诉我的方法:

enter image description here

像这样:

tf workspaces /updateComputerName:MyOldComputerName

但是我得到了以下反馈:

每当指定/updateComputerName或/updateUserName时,都必须指定/collection选项。

为了获得集合名称,我运行了:

tf workspaces

它列出了我的集合,我得到了我的集合名称(...myusername.visualstudio.com...)

然后我运行了:

tf workspaces /collection:http://myusername.visualstudio.com /updateComputerName:MyOldComputerName

没有起作用,因为我得到了这个:

TF31002:无法连接到此Team Foundation服务器: http://myusername.visuals tudio.com/defaultcollection。 Team Foundation Server Url:http://myusername.visualstudio.com/defaultcollection

可能失败的原因包括: - Team Foundation Server的名称、端口号或协议不正确 - Team Foundation Server离线。 - 密码已过期或不正确。

技术信息(供管理员使用):远程服务器返回错误:(404) Not Found。

然后我注意到我输入了http而不是https,进行更正、重试,它就成功了!


4
我相信你刚刚帮我省了8小时的麻烦。谢谢! - patrick
1
如果登录失败,请添加参数 > /login:用户名,密码 - LKF
1
神器。谢谢。 - Will
@Will:很高兴能帮上忙!圣诞快乐! - Andrei Rînea

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

以管理员身份在CMD中运行此命令

tf workspaces /collection:https://SERVER_NAME.visualstudio.com/DefaultCollection /updateComputerName:OLD_COMPUTER_NAME

8

要在 Visual Studio 2017 中使其正常工作,请使用以下方法(新位置)

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe workspaces /collection:https://youraccountnamehere.visualstudio.com /updateComputerName:OLD-COMPUTERNAME

希望这能节省某些人的时间!

4

请看这个链接

Vaccano说:

这个命令解决了问题:

tf workspaces /updateComputerName:MyOldComputerName 
/s:"http://MyServer:8080/tfs/MyCollection"

我需要在想要分配工作区的计算机上运行它(这就是它获取新计算机名称的方式)。


3
tf workspaces /updateComputerName:REPLCATEOLDCOMPUTERNAMEHERE /collection:REPLACETFSURL

示例:

tf workspaces /updateComputerName:DESKTOP-42CLO97 /collection:https://testuserxx.visualstudio.com

VS2017


2

打开命令提示符并输入以下内容:

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

enter image description here

然后使用您的凭据输入以下代码:

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

在CMD提示符中:

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


1
你可以添加新的工作区,然后使用VS 2017删除以前的工作区: 在此输入图片描述

0

打开Visual Studio命令提示符并输入以下命令

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

例如

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

在运行上述命令前后,您可以运行以下命令,以检查计算机上的工作区信息。

请记住: 在客户端计算机(已重命名)上运行所有这些命令,而不是在安装 TFS 服务器的计算机上运行。

如果用户名也被更改,则运行以下命令。

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

希望能有所帮助。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接