M
M
Maxim Timofeev2019-01-15 14:22:45
git
Maxim Timofeev, 2019-01-15 14:22:45

How to have two versions of a file so that 1 is seen by git and the other by the server?

Apparently wedges me.
There is a file, let's say config.php, and I need it to be one in the turnip, but I have another. But at the same time, I would like to have data if it changes in the turnip.
I understand that it would be logical to separate the file and what can change to have in 1, and local variables in another, but it didn’t work out that way. There are options? Or do I want too much?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Decadal, 2019-01-15
@webinar

As described, it will not work, with a pool of changes from a turnip file that is also locally changed, there will be a conflict like 'commit changes first'
Only splitting into config.local.php.example and config.local.php which will be under git ignore
If the point is so that some configs are merged, it would be a good solution to make two files, include both, one will be with the settings from the git, the other will be with the local ones, and the local ones will override the git ones

A
Alex Wells, 2019-06-04
@Alex_Wells

In your case, there is a wonderful thing - environment variables. You add an .env file to the project, refer to its variables in the config and ignore the .env .gitignore. So do it right.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question