简体   繁体   中英

Best way to have default config using git

I have some files *.config.php which I want to keep "default" version in git remote, but in my local workstation I need to change it and if I put these files in .gitignore, still seeing the changes, since theres already a commit with these files.

I find some "bad" ways to keep these files untracked, but it is a quite difficult to do it for every each new developer that comes to development team, because everybody needs to type lots of "git rm --cached " for each config file. Anyway, whats the best way to have default config files and still being able to edit them without git see the changes?

Thanks

Apparently there are ways to expedite the process:

https://stackoverflow.com/a/7532131

apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached

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