I'm using Git to manage a CodeIgniter project. I work on my local machine and push to a remote server, where I test everything. Then I use git ftp push
to update the production site on another host.
Now, to make this work I need three different index.php files, one for every environment, where I just set a different environment variable.
So I need to gitignore the index.php file, and even git-ftp-ignore it. For the ftp it is working. For the normal gitignore it isn't: It keeps updating the index.php file on the remote server.
I tried doing git rm --cached index.php
, but what I get is that it completely deletes the index.php file on the remote server.
What am I doing wrong?
Edit: It seems it's not something I can do with git, but I've found a better way to set the CodeIgniter environment variable.