简体   繁体   English

在VS2013和TFS2015中使用分支时,需要修改分支的项目文件

[英]When using branches with VS2013 and TFS2015, need to modify project files for branch

We're using TFS 2015 with its native source control (non GIT) to host our VS 2013 solutions. 我们正在将TFS 2015及其本机源代码控制(非GIT)用于托管VS 2013解决方案。

Lately, i have created a branch. 最近,我创建了一个分支。 I needed to manually fix the Scc-sections in the vcxproj files, as these contained the branch name explicitly in the SccProjectName-setting. 我需要手动修复vcxproj文件中的Scc节,因为这些文件在SccProjectName设置中明确包含分支名称。 Same when i wanted to merge the branch back to the main trunk. 当我想将分支合并回主干时也是如此。 I needed to take care that the modified sections did not get merged back to the trunk. 我需要注意,修改后的部分不会合并回主干。 This is very annoying. 这很烦人。 How to fix this? 如何解决这个问题?

I have searched and found lots of pages suggesting to use 我搜索并发现很多建议使用的页面

<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>

with the Scc-binding metadata located elsewhere (MSSCCPRJ.scc?). Scc绑定元数据位于其他位置(MSSCCPRJ.scc?)。 This seems reasonable to me. 在我看来,这是合理的。

But i don't understand what we have to do explicitly and what it could break. 但是我不明白我们必须做些什么以及它可能会破坏什么。 I am no expert in TFS setup and configuration. 我不是TFS设置和配置方面的专家。

I also recommend to use below Scc, actually it's the default Scc setting when you add a project to source control in TFS. 我还建议在Scc以下使用,实际上,这是将项目添加到TFS中的源代码管理时的默认Scc设置。

<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>

In your case, you can try to remove the branch name in the SccProjectName-setting for both Main and another branches if that is an option without any policy limits. 在您的情况下,您可以尝试在SccProjectName-setting中删除Main和另一个分支的分支名称(如果这是一个没有任何策略限制的选项)。

Another way is trying to exclude the .vcxproj files if there are no any other changes need to be merged back to trunk. 如果没有任何其他更改需要合并回主干,则另一种方法是尝试排除.vcxproj文件。

  • What we do in this case is we perform the merge, then undo the changes for those files we want to exclude. 在这种情况下,我们要做的是执行合并,然后撤消要排除的文件的更改。 Once that is done we checkin the changes. 完成后,我们将签入更改。 When you perform a merge, it only merges in your workspace. 当执行合并时,它仅在您的工作空间中合并。 It doesnt go to the server till you checkin. 直到您签入,它才进入服务器。
  • You can use tf.exe from the command line to force the .vcxproj files not to be included in the merge operation: tf.exe merge /discard <path to .vcxproj file > <destination branch> 您可以从命令行使用tf.exe来强制.vcxproj文件不包括在合并操作中: tf.exe merge /discard <path to .vcxproj file > <destination branch>

    See Merge Command for details. 有关详细信息,请参见合并命令 Also reference this thread : Exclude a config file from the merge process 另请参考此线程: 从合并过程中排除配置文件

For MSSCCPRJ.SCC related info, please refer to this article , hope that helps. 有关MSSCCPRJ.SCC的相关信息,请参阅本文 ,希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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