8

How would I work with the TFS command line client that is running on a aix/unix box to run the tf commands. For example I'm unable to create local windows workspaces that connect to the tfs version control folders that are on a windows server. The version of command line client that is running on the unix box is (/TFS/TEE-CLC-12.0.0). I can't find any documentation how the client can be used when running on unix to connect local windows files to the version control files on a server.

jjohnston
  • 83
  • 1
  • 3
  • What have you tried? Have you followed the tutorial at http://msdn.microsoft.com/en-us/library/cc31bk2e.aspx ? – Edward Thomson Feb 12 '14 at 23:41
  • Thanks for the link Edward. I am using the command line client which is independent from visual studio. My code is cobol so the programmers here don't use visual studio. I am testing out this client to possible change how we maintain our code repository. 1. The plugin is loaded, configued and working on the unix server. 2. I can create workspaces on our tfs windows server (our code repository resides there). However I can't figure out how to create a local workspace on my computer and map/connect/checkin my code changes to the tfs repository via the plugin loaded on the unix box. – jjohnston Feb 13 '14 at 18:12
  • Indeed, the commands for the cross-platform command-line client (part of Team Explorer Everywhere) are the same as the command-line client bundled with Visual Studio. You need to use the `tf workspace /new` command to create a workspace. There should be examples in the link I provided. – Edward Thomson Feb 13 '14 at 18:14
  • Those are not examples that are running from a unix server. They are running in the command prompt from a windows computer. – jjohnston Feb 13 '14 at 19:22
  • Yes, that's correct. But since - as I mentioned - the commands are the same on Unix and on Windows, that shouldn't matter. If you're running into a problem while running the commands, could you post additional details of the problem you're running into? – Edward Thomson Feb 13 '14 at 19:39
  • For example this is the suggested command to create a new workspace: tf workspace -new Beta1 -collection:http://myserver:8080/tfs/DefaultCollection. Would I substitute that collection url for a local folder (e.g., C:\tfsprojects\test) in order to create a local workspace? From the explanations I've seen the collection is the version control folder and you need to be sourced to your local folder when you create a new workspace (e.g., c:\tfsprojects\test>tf workspace -new -collection:http://myserver:8080/tfs/DefaultCollection), but this particular command would not work from a unix server. – jjohnston Feb 14 '14 at 15:00
  • No, you do not change the server URL or specify any Windows paths. You just need to specify the server path and a local path on your Unix box. I wrote an answer that walks you through getting the source code locally. – Edward Thomson Feb 14 '14 at 17:13

1 Answers1

13

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...
    
Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • Thanks for the in-depth explanation and answer Edward. How would your example work if your code was located on your local computer at /build/tee/main? If you ran the command cd /build/tee/main from your aix box that would throw an error of /build/tee/main not found, because that path is on your local computer and not on the unix box. Does my question make sense? I'm dealing with 3 moving parts developing on local computer, running the command line client from a unix server, and working with version control code on a separate window server. – jjohnston Feb 14 '14 at 18:31
  • No, I don't understand. My local computer *is* the unix box...? – Edward Thomson Feb 14 '14 at 20:37
  • That's been the issue. Our programming setup is a bit different. We have cobol code that runs on aix boxes and our code repository resides on a windows server, both of which we log into from our local windows machines. – jjohnston Feb 14 '14 at 21:12
  • Okay, well. I don't understand what you *want* TFS to do here. It sounds like you need to *deploy* to the AIX box? Team Explorer Everywhere will only help your Unix box talk to the TFS server. It doesn't - indeed, can't - know about this windows server you have with some code on it. You need to either check it in so that you can do a get on the AIX box or figure out another deployment mechanism (scp? rsync?). Unless I still misunderstand your setup? – Edward Thomson Feb 14 '14 at 21:28
  • Thanks for your help Edward. Your example makes sense now. Is the command line client deployed on the aix box? Mine is deployed from the aix box at /opt/TFS/TEE-CLC-12.0.0. Is this typically? – jjohnston Feb 19 '14 at 20:37
  • @jjohnston Awesome! Yes, that's almost exactly where I have mine installed. – Edward Thomson Feb 19 '14 at 21:34