How to version control config files pragmatically?

Posted by erenon on Stack Overflow See other posts from Stack Overflow or by erenon
Published on 2009-12-29T14:29:59Z Indexed on 2010/03/29 4:43 UTC
Read the original article Hit count: 299

Suppose we have a config file with sensitive passwords. I'd like to version control the whole project, including the config file as well, but I don't want to share my passwords.
That could be good, if this config file:

password=secret
foo=bar

becomes

password=*
foo=bar

and the other users of the vcs could also set up the password on they own. To ignoring the file isn't a good approach, the developers should be aware, if the config file changes.

Example:

Local version: password=own_secret foo=bar

config file in vcs:

password=*
foo=bar

Then suddenly, the config file changes:

password=*
foo=bar
baz=foo

And the local version would become for each developer:

password=own_secret
foo=bar
baz=foo

This is my solution. How could I achieve this behaviour? How do you store your config files? Is there a way to do that, or should I hack something?

© Stack Overflow or respective owner

Related posts about version-control

Related posts about svn