Why is .gitignore ignoring .sass-cache?

My project is as follows:

enter image description here

.gitignore:

/node_modules /dist /.tmp /.sass-cache .sass-cache /bower_component 

I don't know why, but .sass-cache is still installed:

 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 on why?

+6
source share
5 answers

The .gitignore file was most likely updated after the contents of a particular folder were delivered. To complete the circle, run git rm -r --cached .sass-cache/ .

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

+9
source

The problem is that you have already uploaded the .sass-cache folder to the server. You see that it says modified . You must do:

 git rm .sass-cache/* git commit -a -m "removed folder" git push origin master 

The next git status you will not see the folder.

In addition, you do not need to add both

 /.sass-cache .sass-cache 

Only the last is enough

+4
source

These files are already tracked by git, and therefore your .gitignore will not affect them. However, new, unmonitored files will be ignored. See the gitignore documentation for more details .

+3
source

From the wiki:

If you already have a file installed and want to ignore it, Git will not ignore the file if you add the rule later. In these cases, you must first format the file by running the following command in your terminal:

git rm --cached

0
source

If you want to delete already made sass-cache files from your repo - and are on Linux. You can run the find command in the terminal, from the root of your repo file:

 $_ `find . -name "*.scssc" -exec git rm -f {} \;` 

After that, do:

 $_ git commit -m "Remove .scssc cache files." 

Then add these lines to .gitignore with $_ nano .gitignore :

 styles/.sass-cache/* styles/.sass-cache .sass-cache/ *.css.map 
0
source

All Articles