I'm not sure what I'm doing wrong in this case with my .gitignore file, but these files keep showing up.
Background
I'm using Jekyll to build a blog. Jekyll generates _site and .sass-cache directories when it begins serving.
I previously committed these directories before realizing I wanted to ignore them.
To be overly cautious, I added all of the following lines to my .gitignore:
##Jekyll
/_site/
_site/
_site
/.sass-cache/
.sass-cache/
.sass-cache
Since I knew I'd committed these files previously, I:
- Committed the updated
.gitignorefile. - did a
git rm -r --cached . - deleted the
_siteand.sass-cachefolders - ran a
git add .andgit statusshowed that the working directory was clean
Problem
Despite all of that, the updated .gitignore file, and verifying (I think?) that things are clean and good, whenever I run bundle exec jekyll serve and jekyll generates the files, I see .sass-cache and _site show up in my untracked files.
Question
- What am I doing wrong here? Is my .gitignore formed improperly?
- How can I ensure that git never shows these directories in the untracked list?
The .gitignore in its current state can be found here.