user805255
user805255

Reputation: 243

Excluding file extension in TFS2010 version control

I generate with T4 templates some file (*.generated.sql, *.generated.cs). How can i exclude files with this extension from TFS 2010 version control. (no explicit excluding for a file - looking for excluding foe 'all files with extension *.blabla)

Upvotes: 1

Views: 3263

Answers (3)

Ewald Hofman
Ewald Hofman

Reputation: 12668

You can specify the file masks that are used to automatically exclude files from source control: http://www.ewaldhofman.nl/post/2009/08/02/Change-the-file-masks-that-are-excluded-by-Source-Control.aspx

Upvotes: 2

John Saunders
John Saunders

Reputation: 161773

Unless you transform your templates during each build, I would argue that these generated files do belong in source control. They are source in the sense that they are used to generate binary (they are compiled).

On the other hand, if these files are generated during a build, then I would argue that they not only don't belong in source control; they also don't belong in the same folders as the rest of your source code. They should reside in something like "obj\GeneratedSource", which would be used as a source for compilation, but which would be cleaned after the build.

Upvotes: 2

Assaf Stone
Assaf Stone

Reputation: 6317

The simplest way to manage this is with the exclusion filter in TFS' source control explorer.

To access it open the source control explorer, and choose to Add File. It doesn't matter how you do it, as long as the Add to Source Control form opens. At the bottom of the form, in the second to last textbox ("Automatically exclude from source control"), add the file types you want to exclude. To exclude a file type, just add *.filetype. All filters are delimited by semicolons (;).

Hope this helps

Upvotes: 2

Related Questions