.gitignore为什么不忽略.sass-cache? [英] Why isn't .gitignore ignoring .sass-cache?

查看:247
本文介绍了.gitignore为什么不忽略.sass-cache?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目如下所示:

.gitignore:

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

不知道为什么,但是 .sass-cache 仍在执行阶段:

No idea why, but .sass-cache 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?

推荐答案

.gitignore 文件可能在该特定文件夹的内容被暂存后更新。要完成此循环,请执行 git rm -r --cached .sass-cache /

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/.

另外,您在 .gitignore 中只需要一个条目;最好在前面或末尾用斜杠表示它作为一个目录。

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.

这篇关于.gitignore为什么不忽略.sass-cache?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆