I have a PHP config file i'd like to manipulate locally but ignore those changes during git commits
to my master repository. I had a .gitignore
file which used to ignore this PHP file but bad things happen and now the config.php
file is no longer being ignored and I can't remember how to re-ignore it.
I know people on SO say to use git rm --cached <filename>
but I can't for the life of me figure out how not to make git rm...
keep deleting my config.php file.
I'm wondering if someone can list how to ignore my config.php such that I can keep editing it locally but these changes don't get added to the repo.
here's the entire contents of my .gitignore
:
application/config.php
here's some php code in my config.php
I'd like to keep local and NOT go in my master repo:
$config['base_url'] = "http://localhost/";
//$config['base_url'] = "http://mysite.com/"; // this is the code and NOT
// "http://localhost" that i'd like to keep in my repo
This is what deletes my file:
git rm --cached application/config.php
- make changes to the
application/config.php
file and another file (as a control) git commit -m 'config.php shouldn't be changed'
result:
2 files changed, 1 insertions(+), 370 deletions(-)
(config.php
is 370 lines long)