My .gitignore file gets ignored and the files which should be ignored are still visible.
user@host ~/workdir % git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# modified: .htaccess
# modified: application/controllers/statistics.php
no changes added to commit (use "git add" and/or "git commit -a")
user@host ~/workdir % cat .gitignore
user@host ~/workdir %
Ignoring files in git doesn't mean that you won't push them. It means that you won't version control them. If you don't want to push then, I suggest you create a local branch which will contain stuff for the local machine and then merge necessary changes to a branch which you'll push to remote.
I think you've already
added your files and are now trying to ignore them.