Question

It is really anoying to recreate a config file after every git pull. Is there a good method to keep a file from being overwritten, or better yet, only if the remote config file has changed?

Was it helpful?

Solution

I always try to store config files out of the repo. So I usually have a config.xml.example or _config.xml (some filename that isn't actually used) and include the real config.xml in your .gitignore file. Once you clone the repository, copy and paste the file and update the configuration settings. You can also store production config files in a special directory on your server, and always copy this file over when deploying a build (that way you always know your configuration file will be the right data). This also lets you store passwords outside of a repository for security.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top