TFS Version Control Tidbit: How to ban a specific file extension from version control

To make it difficult for a user to add/check-in a file of a specific type, you can use the Forbidden Patterns  check-in policy from the Team Foundation Server Power Tools for TFS 2008. 

Forbidden Patterns Policy
Allows you to specify a file extension or a regular expression that you can use to keep certain file types from being checked in to source control. This policy is most useful for DLL-files, build artifacts, or automatically-generated Web site files that are generated automatically during development. Versioning these files is not appropriate since they are on demand and specific to the development environment. The Forbidden Patterns policy scans each of the file names on check-in. It determines if there is a match. If there is a match, the check-in is blocked.

While this isn’t foolproof (policy can be overridden), it does raise the bar.

The Forbidden Patterns Policy can be downloaded as part of the Team Foundation Power Tools for TFS 2008 from the MSDN site.


– Steve