alexchenco alexchenco - 1 year ago 97
Git Question

Why isn't .gitignore ignoring .sass-cache?

My project looks like this:

enter image description here



No idea why, but
is still being staged:

User@User-PC MINGW64 /e/alex/istagingadmindashboard/frontEnd (deve)
$ git add .

User@User-PC MINGW64 /e/alex/istagingadmindashboard/frontEnd (deve)
$ git status
On branch deve
Your branch is up-to-date with 'remotes/origin/deve'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: .sass-cache/a1ee9da9874bbf1b217c6f2a5cd8c2c7c5ee78fe/main.scssc
modified: app/scripts/building/uploadPage.js
modified: app/styles/main.scss
modified: app/views/building/uploadproject.html

Any ideas of why?

Answer Source

The .gitignore file was likely updated after that particular folder's contents were staged. To complete the circle, perform git rm -r --cached .sass-cache/.

Also, you only need one entry for it in .gitignore; preferably, one with a slash at either the front or the end to denote it as a directory.

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