0

I tried this solution with no lucK: How I can store some local changes that survives git reset --hard

Basically I have a script on the server that deploys my git to sites. Even though I did:

git update-index --no-skip-worktree -- config/production.ini

Are there any solutions that'll allow me to successfully not have this config file being overridden each time?

My script does:

129           exec('git reset --hard', $output);
134           exec('git pull '.$this->_remote.' '.$this->_branch, $output);

So basically a git reset then git pull.

Community
  • 1
  • 1
meder omuraliev
  • 183,342
  • 71
  • 393
  • 434

1 Answers1

1

Don't version-control your config file.

Presumably you have modifications to your production.ini file that you want to keep, but which are sensitive and shouldn't be version controlled.

This is extremely common, and the generally accepted solution is to have a production.ini.example which is version controlled, which is copied to an un-tracked file production.ini where you can make changes in production.

user229044
  • 232,980
  • 40
  • 330
  • 338