We have certain configuration files which we want to be in version control as they specify project's default settings: search path, conditional defines etc. Unfortunately these files are also used by the IDE (Delphi 5) to hold temporary information. The IDE continually updates the files during development which causes Tortoise to flag the working directory as modified all the time even though all that might have happened is a build of the project. Sometimes we do genuinely want to commit changes to these files, for example if the projects search path dependencies change, but the grand majority of the time they are just a source of noise.
My first thought was to check the files out, apply a global ignore pattern in TortoiseSVN to ignore the offending files types and remove the global ignore when I have made a genuine change to the code I want to check-in. It appears however that if a version of a file is already in the repository, Tortoise will not ignore it.
Is there a way that I can set this up so that
1) The files get pulled in during a checkout
2) There is some means of ignoring changes to these files
3) There is an way of checking in significant changes to the files if required
Best Answer
The general solution to allowing local modifications to version-controlled configuration files is not to keep the config file itself under version control, but to version a template of it, e.g. with
.template
appended to the filename.The first time a developer checks out the project, they make a copy of this file, removing the .template from the filename of the copy. Then they add the copy (the non-template) to the ignore list to ensure it is not accidentally added or committed.
Any changes that are made to the config which need to go into version control, must be made to the template. And each time a developer updates and finds a change in the template, they must again follow the copy/rename procedure. But hopefully this will not be often.