RWL01
RWL01

Reputation: 478

Can multiple Team projects point to the same source control in TFS?

I'm new to TFS so I'm trying to figure a couple of things out.

1) Are you allowed to reference the same code from multiple Team Projects?

2) How do you change the source control location for an existing team project?

Upvotes: 0

Views: 1263

Answers (3)

pantelif
pantelif

Reputation: 8544

The Server-Paths for each checked-in module has a format like $/TeamProject1/foo.cs.

On the client-side, those files shall reside somewhere on the local HDD. The mapping between a $/TeamProject1/foo.cs & a local path C:/MyFiles/foo.cs is crafted by a TFS Workspace. Check here for an intro.

To your questions:
1) Are you allowed to reference the same code from multiple Team Projects?

On the server side:
You can have branched, or simply commonly named source files, as in
$/TeamProject1/foo.cs & $/TeamProject2/foo.cs, but those are surely different files.

On the client side:
Each locally mapped source control folder can only be correlated with one local path. In case you try to map both $/TeamProject1/foo.cs & $/TeamProject2/foo.cs into C:/MyFiles/foo.cs you 'll be denied the second time with something like that:
enter image description here
In all, I think the answer to this question is a 'No'.

2) How do you change the source control location for an existing team project?

I suppose that you are trying to change the local mapping, for example from
$/TeamProject1 & C:\Folder\teamProject1 into
$/TeamProject1 & C:\AnotherFolder\TeamProject1

In order to do that navigate in VStudio to "File">"Source Control">"Workspaces.." then select your workspace & hit "Edit". There you can see the existing mappings and edit them.

Upvotes: 1

Matt Cofer
Matt Cofer

Reputation: 2982

You can create a workspace that contains code from multiple team projects.

So, if I understand your first question correctly then yes you can do that. Technically the code will be in one Team Project but you can mix it into other Team Projects on your machine or build server using workspaces.

Are you familiar with workspaces yet?

Upvotes: 0

AaronS
AaronS

Reputation: 7703

Can you give an example of what you're trying to accomplish in question 1?

For question two, I'm assuming you're talking about where the code lives on a development desktop. For this, open visual studio and go to: File -> Source Control -> Workspaces. Then click Edit for your workspace. You can change the location here for each project you have mapped.

Upvotes: 0

Related Questions