Change computer name for a TFS Workspace

2019-01-20 23:29发布

My System Administrator renamed my computer. So where it was "MyLaptop2" it is now just "MyLaptop".

So now all my source control bindings and checked out files are looking for a workspace with "MyLaptop2".

Is there a way to redirect that workspace to my renamed (but still the same) computer?

15条回答
地球回转人心会变
2楼-- · 2019-01-20 23:43

To avoid get and map after creating new workspace

  1. Run cmd

  2. Navigate to visual studio IDE path. Something like this:

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
    
  3. Run this command:

    tf workspaces /updateComputerName:MyOldComputerName /s:"http://MyServer/tfs/MyCollection"
    
  4. In "manage workspace", delete the added workspace (named as your current computer name), and rename the old one to your current computer name.

In this scenario you don't need any extra get and map.

查看更多
我命由我不由天
3楼-- · 2019-01-20 23:43
  1. Make a copy of project folder
  2. Map original local folder in TeamExplorer/SourceControl
  3. Set read-only attribute to original local folder and sub-folders
  4. Load project from original folder, Go online and Get latest version. Local files will be overwritten.
  5. Close solution, delete original folder, restore copy with original folder name
  6. Open solution, Go online and you can check-in files without conflicts.
查看更多
萌系小妹纸
4楼-- · 2019-01-20 23:47

Just to clarify for users of TFS Online (MS hosted TFS) - if your url was "mytfs.visualstudio.com" and your collection is "DefaultCollection", the commands as listed above will be:

To list all workspaces: tf workspaces /owner:* /computer:* /server:https://mytfs.visualstudio.com/DefaultCollection

To update from OldPcName: tf workspaces /updateComputerName:OldPcName /server:https://mytfs.visualstudio.com/DefaultCollection

In short, specify HTTPS, ignore the port and don't add a /tfs/ folder structure.

You can then select (and rename if desired) the workspace by going to source control explorer and using the Workspace drop down.

查看更多
ゆ 、 Hurt°
5楼-- · 2019-01-20 23:48

Given below how it worked for me.

Step 1. Go go Visual Studio Command Prompt

Step 2. In above command prompt type command tf workspaces. This command will show all the workspaces you created in your machine and also the collection name. Look carefully for first line of the result of the command.

Step 3. In same command prompt type command tf workspaces /updateComputerName:OLDCOMPUTERNAME /s:"collection name as shown above"

The OLDCOMPUTERNAME AND COLLECTION NAME ARE VERY IMPORTANT HERE.

查看更多
ら.Afraid
6楼-- · 2019-01-20 23:48

If someone don't feel so comfortable with CommandPromt (like me) This Infographic post can help you . here is the text snippet from the blog:

Click on FILE menu on your Visual Studio 2013. Now click on

Source Control -> Advanced -> Workspaces..

This will open a window with title "Manage Workspaces". It shows the list of workspaces on this computer to which you have access. The list contains 4 columns for:

  1. Workspace Name
  2. Computer
  3. Workspace Owner
  4. Comment (if added while creating workspace)

Add Workspace: If Workspace Manager is empty, probably you didn't added one yet. Click on Add button and put your server/ username/ password and it will list the added one for you.

Update Workspace: Later if you have changed your computer name or anyway you want to update your workspace accordingly, select the workspace you want to edit and click on Edit button; here you can update your workspace details.

查看更多
We Are One
7楼-- · 2019-01-20 23:53

I had the same problem and came here. But then I just closed and reopened visual studio and it was fine. So... that might be the solution for some.

查看更多
登录 后发表回答