简体   繁体   中英

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?

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:
在此处输入图片说明
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.

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM