Dealing with configuration files in Subversion
January 14, 2009 – 6:43 pm Tags: ToolsHere’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.

3 Responses to “Dealing with configuration files in Subversion”
I do that with index.php AND/OIR development.php as well. Since they should bootstrap my own environment
By Alan on Jan 15, 2009
Nice, pretty good tip, I made that for my zf cms, I got some config xml files like:
config.example.xml
routers.example.xml
shared.example.xml
widgets.example.xml
By Juan Felipe Alvarez Saldarriaga on Jan 15, 2009
I do something similar with my server-specific config.
One other thing you can do is to pre-emptively set the svn:ignore property on the containing folder, so that any concrete config.php is ignored by subversion (to avoid any accidental checkins).
By Ciaran McNulty on Jan 15, 2009