I am attempting to use git to manage deployment to my live website. The problem that I'm having is that I have a couple of settings files that I don't want to be updated when I push to production
what I'm looking at doing is either using a hook or smudge/clean to change the file contents for example from
<?php
define('DB_NAME', 'live');
define('DB_HOST', '127.0.0.1');
define('DB_USER', 'live_user');
define('DB_PASS', 'livePass');
to
<?php
define('DB_NAME', 'local');
define('DB_HOST', '127.0.0.1');
define('DB_USER', 'local_user');
define('DB_PASS', 'localPass');
Is there anyone who could talk me through the process please
I did wonder about using post-receive hook and a shell script to replace the contents, but ideally I want the contents in the repo to be changed before I run git checkout -f not changed in the live copy after