In .gitignore I have a rule that excludes a path settings.php
However, that rule has to be disregarded (the file has to be included in git), but for special reasons (the .gitignore file gets frequently reset to default from outside) I prefer not to change the .gitignore itself, but rather to override it by setting a counter-rule in the core.excludesfile file.
So in the relevant core.excludesfile file I put: !settings.php
to override the above rule.
But it does NOT work. I suspect that rules in .gitignore have priority over the ones in the global file with exclusions (this is how I understand https://www.kernel.org/pub/software/scm/git/docs/gitignore.html).
Is there any way to override a rule set in .gitignore by a rule in core.excludesfile or elsewhere?
settings.php
, a more typical approach would be to commit a templatized version,settings.php.example
and use a tool like make or another templating language to generate thesettings.php
at build time. The values for settings in this example would be stored in some other configuration file or in environmental variables, which isn't committed to git for security reasons. 12factor.net/config