多个团队项目是否可以指向 TFS 中的相同源代码控制?
我是 TFS 的新手,所以我正在尝试解决一些问题。
1) 是否允许您从多个团队项目引用相同的代码?
2) 如何更改现有团队项目的源代码控制位置?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
每个签入模块的服务器路径的格式类似于
$/TeamProject1/foo.cs
。在客户端,这些文件应驻留在本地 HDD 上的某个位置。
$/TeamProject1/foo.cs
与$/TeamProject1/foo.cs
之间的映射;本地路径 C:/MyFiles/foo.cs 是由 TFS 工作区创建的。请查看此处了解简介。对于您的问题:
1) 您是否可以从多个团队项目引用相同的代码?
在服务器端:
您可以拥有分支或简单命名的源文件,如下所示
$/TeamProject1/foo.cs
&$/TeamProject2/foo.cs
,但这些肯定是不同的文件。在客户端:
每个本地映射的源代码管理文件夹只能与相关一个本地路径。如果您尝试同时映射
$/TeamProject1/foo.cs
&$/TeamProject2/foo.cs
到C:/MyFiles/foo.cs
你会第二次被拒绝,类似这样的东西:总而言之,我认为这个问题的答案是“否”。
< em>2) 你怎么样更改现有团队项目的源代码控制位置?
我想您正在尝试更改本地映射,例如来自
$/TeamProject1
&C:\Folder\teamProject1
进入$/TeamProject1
&C:\AnotherFolder\TeamProject1
为此,请在 VStudio 中导航至“文件”>“源代码管理”>“工作区..”,然后选择您的工作区和工作区。点击“编辑”。在那里您可以查看现有的映射并对其进行编辑。
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 pathC:/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
intoC:/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.
您能否举例说明您在问题 1 中想要实现的目标?
对于第二个问题,我假设您正在谈论代码在开发桌面上的位置。为此,打开 Visual Studio 并转到:文件 ->源代码控制 ->工作空间。然后单击您的工作区的编辑。您可以在此处更改已映射的每个项目的位置。
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?