[英]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. 我是TFS的新手,所以我想尝试一些事情。
1) Are you allowed to reference the same code from multiple Team Projects? 1)您被允许从多个团队项目中引用相同的代码吗?
2) How do you change the source control location for an existing team project? 2)您如何更改现有团队项目的源代码控制位置?
The Server-Paths for each checked-in module has a format like $/TeamProject1/foo.cs
. 每个已签入模块的服务器路径的格式均类似于$/TeamProject1/foo.cs
On the client-side, those files shall reside somewhere on the local HDD. 在客户端,这些文件应驻留在本地HDD上的某个位置。 The mapping between a $/TeamProject1/foo.cs
& a local path C:/MyFiles/foo.cs
is crafted by a TFS Workspace. $/TeamProject1/foo.cs
与本地路径C:/MyFiles/foo.cs
之间的映射是由TFS工作区制作的。 Check here for an intro. 在这里查看介绍。
To your questions: 对您的问题:
1) Are you allowed to reference the same code from multiple Team Projects? 1)您被允许从多个团队项目中引用相同的代码吗?
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. $/TeamProject1/foo.cs
和$/TeamProject2/foo.cs
,但是这些文件肯定是不同的文件。
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: 如果您尝试将$/TeamProject1/foo.cs
和$/TeamProject2/foo.cs
到C:/MyFiles/foo.cs
,则第二次将被拒绝,例如:
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? 2)您如何更改现有团队项目的源代码控制位置?
I suppose that you are trying to change the local mapping, for example from 我想您正在尝试更改本地映射,例如从
$/TeamProject1
& C:\\Folder\\teamProject1
into $/TeamProject1
& C:\\Folder\\teamProject1
进入
$/TeamProject1
& C:\\AnotherFolder\\TeamProject1
$/TeamProject1
& C:\\AnotherFolder\\TeamProject1
In order to do that navigate in VStudio to "File">"Source Control">"Workspaces.." then select your workspace & hit "Edit". 为了做到这一点,请在VStudio中导航到“文件”>“源代码管理”>“工作区..”,然后选择您的工作区并点击“编辑”。 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? 您能否举例说明您要在问题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. 为此,打开Visual Studio并转到:文件->源代码控制->工作区。 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. 从技术上讲,代码将在一个Team Project中,但是您可以将其混合到计算机上的其他Team Project或使用工作区构建服务器中。
Are you familiar with workspaces yet? 您是否熟悉工作区?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.