Fu86 Fu86 - 1 year ago 102
Git Question

.gitignore doesnt ignore files

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 %

The files are in version control, but with sensible changes I dont want to push. git rm ... is not an option because the files should be in version controll (with other settings in the files). I just dont want to push my changes on this files.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download