简体   繁体   English

Supress Merge / Conflict在“获取最新版本”中的项目中有几个文件,或者在Project中但在TFS中没有

[英]Supress Merge/Conflict for a few files in a project on Get Latest Version, or, have in Project but not in TFS

I would like to Supress the Merge/Conflict checking for a few source files in a project on Get Latest Version. 我想在获取最新版本的项目中禁止合并/冲突检查一些源文件。 This is because these source files are autogenerated by a pre-build step. 这是因为这些源文件是通过预构建步骤自动生成的。 I just want them to be either left with 'local copy' or overwritten by the server version, because they're replace before building anyway and it doesn't matter. 我只希望它们保留“本地副本”或被服务器版本覆盖,因为无论如何在构建之前都将它们替换掉,这并不重要。

When somebody on my team does a Get Latest Version, of course, these they get merge conflict errors, which isn't a big deal, but since the team changes from time to time, I get emails for a few weeks from new team members saying 'Am I going to lose my changes if I overwrite', until they finally remember to look at the filename. 当然,当我团队中的某人获得“获取最新版本”时,这些人会遇到合并冲突错误,这没什么大不了的,但是由于团队会不时发生变化,因此我会收到几周来自新团队成员的电子邮件说“如果覆盖将丢失所做的更改”,直到他们最终记得查看文件名。

Which of course caused a dev to get lazy once and ignore a merge warning, on a real source file ... and lose his changes! 当然,这会导致开发人员一次懒惰并忽略真实源文件上的合并警告……并丢失他的更改!

Is there any way to tell TFS not to worry about this ... or, better yet, since the pre-build step always creates new versions of these files, just have them in the project (they're needed for building) but not in TFS? 有什么方法可以告诉TFS不必为此担心……或者,更好的是,由于预构建步骤总是创建这些文件的新版本,因此只需将它们放在项目中(它们是构建所必需的)即可,而无需在TFS中?

You can always remove the binding of that file, so that it's not added to SourceControl. 您始终可以删除该文件的绑定,这样就不会将其添加到SourceControl中。

  1. Select the file in your solution. 在解决方案中选择文件。

  2. In Visual Studio, File -> Source Control -> Exclude file from source control 在Visual Studio中,文件->源代码管理->从源代码管理中排除文件

在此处输入图片说明

The file will be part of your project but wont be under sourcecontrol. 该文件将是您项目的一部分,但将不受源代码管理。 Basically it adds an entry to the ".vspscc" file to ignore the particular file. 基本上,它会在“ .vspscc”文件中添加一个条目以忽略特定文件。

在此处输入图片说明

Example from Vs2008 solution file. Vs2008解决方案文件中的示例。

Edit by OP 由OP编辑

  • Note, as stated, this is not on the right-click of the file in project explorer! 注意,如上所述,这不是在项目资源管理器中的文件上单击鼠标右键!
  • Visual Studio 2012 has it hidden a bit better then vs 2008: 与2008年相比,Visual Studio 2012具有更好的隐藏性: 在此处输入图片说明

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

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