Mr. Boy
Mr. Boy

Reputation: 63738

Creating new workspace from TFS commandline - root working dir always added?

If I run tf workspace /new /noprompt to create a local TFS workspace, it appears to automatically create a working folder mapping of $/ -> current-dir. This is annoying as I have to remove it before setting up the working folders I actually want. It also means tf workspace will fail if another workspace has a working folder to any any sub-dir of my current directory.

e.g. if D: is my TFS dir, running D:\>tf workspace /new /noprompt ... will fail if any other working folder is set up, because the automatic mapping /$ -> d:\ conflicts.

Isn't it possible to create the workspace with no initial working folders? Otherwise I deliberately have to change-dir to some 'fake' directory to make sure.

Upvotes: 4

Views: 2931

Answers (2)

user3493187
user3493187

Reputation: 21

I found another solution to this problem. tf workspace /new command automatically creates mapping between $/ and current directory. Thus, you need to do these steps:

  1. Change your current folder
  2. Run tf workspace /new command. It creates unneeded $/ mapping
  3. Run tf workfold /map command which maps necessary TFS folder into current folder. It overrides unnecessary $/ with the value you provide.

Upvotes: 2

KMoraz
KMoraz

Reputation: 14164

Use existing workspace as a template: tf workspace /new /template:<wokspacename>

Alternatively use the tf workfold command.

Upvotes: 0

Related Questions