简体   繁体   中英

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?

You can always remove the binding of that file, so that it's not added to SourceControl.

  1. Select the file in your solution.

  2. In Visual Studio, File -> Source Control -> Exclude file from source control

在此处输入图片说明

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.

在此处输入图片说明

Example from Vs2008 solution file.

Edit by 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: 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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