Which folders should I ignore when using version control on a project developed on the CodeIgniter framework?
I am already ignoring the application/cache folder, but are there any else?
It is possible, however, to have multiple sets of applications that share a single CodeIgniter installation, or even to rename or relocate your application directory. If you would like to rename your application directory you may do so as long as you open your main index.php file and set its name using the $application_folder variable:
All files in this directory live under the CodeIgniter namespace. The public folder holds the browser-accessible portion of your web application, preventing direct access to your source code. It contains the main .htaccess file, index.php, and any application assets that you add, like CSS, javascript, or images.
While you have a lot of flexibility in how you use the application directory, the files in the system directory should never be modified. Instead, you should extend the classes, or create new classes, to provide the desired functionality. All files in this directory live under the CodeIgniter namespace.
If you would like to share a common CodeIgniter installation to manage several different applications simply put all of the directories located inside your application directory into their own sub-directory. For example, let’s say you want to create two applications, named “foo” and “bar”.
You can ignore any application generated logs and any development specific configuration files. Here's a commonly used .gitignore file for CodeIgniter:
*/config/development
*/logs/log-*.php
*/logs/!index.html
*/cache/*
*/cache/!index.html
https://github.com/github/gitignore/blob/master/CodeIgniter.gitignore
Beyond the default github codeigniter template provided by birderic, (at https://github.com/github/gitignore/blob/master/CodeIgniter.gitignore for good measure) I also like to simply exclude any php file in the /config director with
*/config/*.php
Some third party apps, like HybridIgnite, like to put their configuration files in the /config directory and a limited config block might enable on of these files to be tracked... Better safe than sorry...
To make it clear how config files should work, I keep a copy of the default files (with no passwords of course) in a seperate config_template directory.
HTH, -FT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With