my issue is not the same as Why doesn't gitignore work in this case? nor .gitignore is not working
files/conf.php is already in .gitignore, but git status still shows its modification, why?
i mean this file should not be tracked if it is in .gitignore...
cat .gitignore
files/conf.php
[root@home blogmi]# git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: files/conf.php
#
no changes added to commit (use "git add" and/or "git commit -a")
.gitignore
only ignores untracked files. Once you've started tracking a file (as you've done with files/conf.php
), it will not be ignored.
You can use git rm --cached files/conf.php
to delete the file from git without actually deleting it from the filesystem. After you commit that, the file will start being ignored properly.
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