I always recommend a filter driver with:
- a template for those setting files (versioned in Git)
- some files with the right values depending on the environment
- a script able to build the actual setting files (as a ‘smudge’ script)
See “How to keep different content of one file in my local and github repository?” for more details.