Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to exclude some files from checkin (TFS)?

Tags:

We use configuration files within various projects under source control (TFS), where each developer has to make some adjustments in his local copy to configure his environment. The build process takes care about replacing the config files with the server configuration as a part of the deployment, so it doesn't actually matter what is in the repository. However, we would anyway like to keep some kind of a default non-breaking version of config files in the repository, so that e.g. people not involved in the particular project won't run into troubles because of local misconfiguration.

We tried to resolve this by introducing the check-in policy that simply forbids to check-in the config files. This works fine, but just because we're lazy to always uncheck those checkboxes in the pending changes window, the question comes : is it possible to transparently disable the check-in of particular files without keeping them out of source control (e.g. locking their current version) ?

like image 598
Tomas Vana Avatar asked Feb 12 '10 14:02

Tomas Vana


1 Answers

Your primary options:

  • If you primarily use Visual Studio integration, simply marking those files as "Exclude From Source Control" in your solutions/projects might be enough.
  • An administrator could take & hold a lock on the file. TFS supports two lock types depending on where in the process you want developers to get slapped with a warning: http://blogs.msdn.com/phkelley/archive/2008/11/12/everything-you-ever-wanted-to-know-about-locks.aspx

There are a few other ways but I think these are the clear favorites.

like image 162
Richard Berg Avatar answered Oct 03 '22 18:10

Richard Berg