Dealing with configuration files in Subversion

Tags:

Here’s a quick tip on how to deal with configuration files when working with Subversion. This probably applies to other VCS’s too like CVS or Git.

You probably have noticed this: you have a configuration file or such, and you need to keep it in SVN, but committing it would be a problem as updating it on other machines would mean their own configurations get overwritten.

So how to solve this? Simple: Instead of storing the configuration file with its own name in SVN, rename it to something like config.base.php, and fill it with some example configuration values and commit that instead. This way each developer can simply create a copy of config.base.php on their boxes and do their own configurations there, without having to worry about an svn update overwriting their settings.