I see three options:
-
either you add these files to your
.gitignore, don’t commit them into the repository. You may optionally provide templates for these files (something likeconfig.php.example), for other people to customise them. That way, they can keep their config and pull the changes easily. -
or you put these files outside of the repository, and reference them with a relative path.
define('CONFIG_DIR', '../config/'); -
(not recommended, submodules are hard) or you put these files in a git submodule. That’ll be a little longer though 😉
For reference, the Symfony framework (PHP) uses the first option and provides configuration templates.
I’ve used successfully option 2 in many projects, it just works, but is less user-friendly.
Never used option 3 for this kind of cases, and submodules are probably not the best tool for this. It can work though…