简体   繁体   中英

Best way to preserve config file between git pulls

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM