简体   繁体   English

多个团队项目可以指向TFS中的相同源代码控制吗?

[英]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.csC:/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 $/TeamProject1C:\\Folder\\teamProject1进入
$/TeamProject1 & C:\\AnotherFolder\\TeamProject1 $/TeamProject1C:\\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.

相关问题 与 Visual Studio (2017)、小团队、多个项目集成的源代码控制的最佳选择是什么? - What are the best options for source control integrated with visual studio (2017), small team, multiple projects? TFS-向团队项目添加解决方案-源代码管理中未包含的某些文件 - TFS - Adding Solution to Team Project - Some files not included in Source Control 在源代码管理资源管理器中未显示的两个团队项目中有一个 - One out of two Team Projects not shown in Source Control Explorer 在Visual Studio Team Services中将所有项目上移(TFS源代码管理) - Moving all items up one level in Visual Studio Team Services (TFS Source control) Visual Studio 2017 Team Fundation Server(TFS) 自动添加到源代码管理不起作用 - Visual Studio 2017 Team Fundation Server(TFS) automatic add to source control not working 将新项目添加到源代码管理TF10175时出现问题:团队项目不存在 - Issue adding new projects to source control TF10175: The team project does not exist 源代码管理 - 开源项目 - Source Control - Open Source Projects 在不保留源代码控制信息的情况下,从TFS和Git复制Visual Studio项目 - Copying Visual Studio projects out of TFS and Git without retaining source control information TFS:Git与团队基础版本控制 - TFS: Git vs Team Foudation Version Control 使用Source Control在VS2015中定位多个项目 - Targeting multiple projects in VS2015 with Source Control
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM