Why is .gitignore not ignoring my files?

Richard picture Richard · Jul 30, 2017 · Viewed 80.1k times · Source

See the image below. My .gitignore file should be ignoring all files in src/dist, but isn't.

enter image description here

Answer

Elmar Peise picture Elmar Peise · Jul 30, 2017

.gitignore only ignores files that are not part of the repository yet. If you already git added some files, their changes will still be tracked. To remove those files from your repository (but not from your file system) use git rm --cached on them.