Git - Committing Machine Specific Configuration Files

Posted by Gordon on Stack Overflow See other posts from Stack Overflow or by Gordon
Published on 2009-09-08T22:13:45Z Indexed on 2010/06/08 6:12 UTC
Read the original article Hit count: 204

Filed under:
|
|

A common scenario when I develop is that the codebase will have several config files which require machine specific settings. These files will be checked into Git and other developers will always accidentally check them back in and break someone else's configuration.

A simple solution to this would be to just not check them in to Git, or even to additionally add a .gitignore entry for them. However, I find that it is much more elegant to have some sensible defaults in the file which the developer can modify to suit his needs.

Is there an elegant way to make Git play nicely with such files? I would like to be able to modify a machine-specific configuration file and then be able to run "git commit -a" without checking that file in.

© Stack Overflow or respective owner

Related posts about git

Related posts about configuration