Devy
Devy

Reputation: 248

Yii2 application git ignore web/index and local configuration

I generate a Yii2 Application then initialized git and commit my change but web/index.php files are in gitignore and not pushed to the repo

Can I knew why and how to regenerate it if I cloned the project again from the remote repo?

Upvotes: 0

Views: 1331

Answers (1)

arogachev
arogachev

Reputation: 33548

By framework design they are in .gitignore, that means you should not modify them at all.

Pretty much all changes that you want to do there can be done through BootstrapInterface.

By default index.php and some other files don't exist, they will appear only after running init command.

You should run it with different options on development and production environment (0 for dev and 1 for prod).

But if for some reason you need to modify it and track with Git, you can always remove it from .gitignore (it's also adviced by @robsch in comment).

Upvotes: 2

Related Questions