Change computer name for a TFS Workspace

前端 未结 15 1486
青春惊慌失措
青春惊慌失措 2020-12-07 08:57

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

相关标签:
15条回答
  • Vaccano's solution worked for me. It took me several tries to get the TFS URL right, so I thought I'd post it for those of you who are using Microsoft's Visual Studio TFS hosting (currently free for small teams).

    From a command prompt on my computer, I first changed to the right directory:

    cd c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
    

    Then I ran the command:

    tf workspaces /updateComputerName:OLDCOMPUTERNAME /s:"https://MYCOMPANY.visualstudio.com/DefaultCollection"
    

    It then told me that my new workspace matched the machine name of my new computer name.

    Hope the path helps.

    0 讨论(0)
  • 2020-12-07 09:22

    I tried running the commands mentioned in the other answers; however, my project is hosted in TFS online (visualstudio.com) so I needed to authenticate first since I kept getting this error message:

    TF400813: Resource not available for anonymous access.
    

    For me it was just easier and much faster to remove the worskpace and reconnect again:

    File > Source Control > Advanced > Workspaces (remove workspace)

    0 讨论(0)
  • 2020-12-07 09:22

    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.

    0 讨论(0)
  • 2020-12-07 09:24

    Go to VS command prompt and type the following:

    tf workspaces

    This will provide you with the available Collections. Copy the path (essentially a URL) of your intended collection. Then type the following:

    tf workspaces /updateComputerName:"OLD_NAME" /collection:"The URL copied from above"

    (exclude the quotes above)

    0 讨论(0)
  • 2020-12-07 09:24

    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.

    0 讨论(0)
  • 2020-12-07 09:25

    This command run in the Developer Command Prompt for Visual Studio did the trick:

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

    It had to be run from the computer I wanted to assign the workspace to (that is how it gets the new computer name.

    0 讨论(0)
提交回复
热议问题