Adrian
Adrian

Reputation: 10911

How do I get tf.exe to set the Source Control Folder to something other than the root?

So I am trying to script with TFS using the tf.exe command. I've looked at the docs but I can't seem to determine how to set the server path such that I don't get the intermediate path in my local directory.

E.g. The server has a dir that I want to get called $/Some/Depth/TargetDir and I want to put it in C:\MyFolder\StoreHere such that all files in TargetDir and all directories beneath it are stored in StoreHere.

Currently, I'm using tf get $/Some/Depth/TargetDir /recursive which results in the files in TargetDir to be downloaded, but in to C:\MyFolder\Storehere\Some\Depth\TargetDir which is not what I want.

I'm using TFS 2010.

Upvotes: 1

Views: 732

Answers (1)

Edward Thomson
Edward Thomson

Reputation: 78743

Workspace mappings control where server paths are retrieved to your local paths. In the behavior you describe, you have a workspace mapping that resolves $/Some/Depth/TargetDir to C:\MyFolder\Storehere\Some\Depth\TargetDir.

Not having seen your actual workspace mappings, it's impossible for me to know exactly why, but this could be as simple as having a workspace mapping from $/ to C:\MyFolder\Storehere.

Instead, you need to map the actual directory you're interested in: you need a mapping from $/Some/Depth/TargetDir to C:\MyFolder\Storehere.

You will need to delete the existing, incorrect mapping first.

You could set this up in the Visual Studio Edit Workspace dialog, or you could use the command-line client:

tf workfold /unmap C:\MyFolder\Storehere
tf workfold /map $/Some/Depth/TargetDir C:\MyFolder\Storehere

Upvotes: 2

Related Questions