meder omuraliev
meder omuraliev

Reputation: 186562

Git keeps resetting my files after a hard reset?

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.

Upvotes: 0

Views: 90

Answers (1)

user229044
user229044

Reputation: 239230

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.

Upvotes: 1

Related Questions