Answer the question
In order to leave comments, you need to log in
Why is gitignore not working?
The .gitignore says "web/index.php", but this file is stubbornly not ignored. Tell me how to be?
PS "git rm -r --cached ." did not help
Answer the question
In order to leave comments, you need to log in
If this file has already been added to the version control system, then you need to remove it from there or roll back to a commit where this file did not exist yet. Adding it to the ignored list will not make it disappear from there.
git filter-branch --force (so that the directory is not removed from the hard drive)
git filter-branch --tree-filter "rm -rf PATH" HEAD
where PATH is the path to the file/folder
How do I remove a directory in Git?
https://help.github.com/en/articles/removing-sensi...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question