-
Place .gitattributes in your home directory
-
Add .gitvars to your project directory and customize it
-
Execute:
git config --global core.attributesfile ~/.gitattributes git config --global filter.subvars.clean 'php -r "echo file_exists(\".gitvars\") ? strtr(file_get_contents(\"php://stdin\"), parse_ini_file(\".gitvars\")) : file_get_contents(\"php://stdin\");"'
-
Set up your IDE to create new PHP files similar to template.php
-
Enjoy ;)
ATTENTION: One caveat of a filter on *.php files is that checkouts of branches with many PHP files become quite slow. I had to disable the filter again for this reason.
It might be better to write a small plugin for your IDE to allow injecting the variables into your template on class creation based on the ini file