How do you create new windows workspace with TFS command line client that is running on unix

浪子不回头ぞ 提交于 2019-11-30 21:33:41

Getting source files down from the server requires three steps on any platform:

  1. Create a workspace on your server. A workspace is what contains the metadata about the files you want on the server and the files you have locally.

    (Technically, you don't create a workspace on the server, you do it on a Team Project Collection which is a logical unit in the server; by default you have a single Team Project Collection on your server called - uncreatively - "DefaultCollection".)

  2. Create one or more working folder mappings that indicate the server's file paths you want to get, and where to put them on your local disk. For an uncomplicated project, this is as simple as mapping $/Project/Folder to C:\Project\Folder or /project/folder.

  3. Do a get, to download the files from the server, placing them in the local folders you configured in step 2.

For example, I have a cross-platform project which happens to be Team Explorer Everywhere itself. In this case my server is https://tee.visualstudio.com/DefaultCollection. My source is located on the server at $/TEE/Main. And I want to place it on my AIX box is /build/tee/main.

Neither the server nor the server folder change because I'm not on Windows. The only thing that changes is - unsurprisingly - the local path. I'll walk through these steps on my AIX 5.2 box:

  1. Create a workspace:

    ethomson@aix:~% tf workspace -new MyWorkspace -collection:https://tee.visualstudio.com/DefaultCollection
    Workspace 'MyWorkspace' created.
    
  2. Create a working folder mapping from $/TEE/Main to /build/tee/main:

    ethomson@aix:~% tf workfold -map '$/TEE/Main' /build/tee/main -collection:https://tee.visualstudio.com/DefaultCollection -workspace:MyWorkspace 
    
  3. Get the files. (Now that you have configured a working folder mapping, you do not need to specify the server URL or the workspace name as long as you specify the local path.)

    ethomson@aix:~% cd /build/tee/main
    ethomson@aix:/build/tee/main% tf get -recursive .
    /build/tee:
    Getting main
    
    /build/tee/main:
    Getting build
    
    /build/tee/main/build:
    Getting .project
    Getting .settings
    ...etc...
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!