Anthony
Anthony

Reputation: 4050

Gitignore CodeIgniter

Before I put my very first (CodeIgniter) application on Github, I have a question about the CodeIgniter .gitignore file (see below). I do not have a development directory in my config directory. Can I just .gitignore */config/* instead? What is the importance of the development directory in the config directory?

*/config/development
*/logs/log-*.php
*/logs/!index.html
*/cache/*
*/cache/!index.html

Upvotes: 2

Views: 8558

Answers (1)

Rick Calder
Rick Calder

Reputation: 18705

Many people set up development and production folders in their config folders. Codeigniter will load the correct file from the correct folder depending on the environment you set in the main index.php

If you're creating a public repository on github copy the files with passwords and keys (your config.php and database.php are the only two that come standard with the framework I believe) to a new folder called development inside config, then remove the passwords and paths and things from the ones in the root folder. Leave the gitignore as is.

This way when you push to git you aren't pushing your personal private information to the project.

Upvotes: 6

Related Questions