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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

So would I git rm it and then push it?
git mv it to production.ini.example. Back up your production production.ini before you pull changes into production, and then restore it as an untracked file after.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.