My .gitignore file contains the items below but git continues to track .jekyll-cache/.
I copied the items from the GH gitignore repo and added .DS_Store.
How do I get git to ignore .jekyll-cache?
_site/
.DS_Store
.sass-cache/
.jekyll-cache/
.jekyll-metadata
Thanks,
Adam
Once a path is added to git you have to explicitly remove it in addition to ignore.
Mac or Linux:
rm -rf .jekyll-cache
git commit . -m "Delete cache directory"
git push
Note that git add
is not needed in general for updating / deleting files.
If you have other changes saves then .
would cover everything. So then you could be more focused with
git commit .jekyll-cache
2 Likes
Here’s my file by the way. Including ignoring bundle config and gems installed with bundle
I prefer to add DS Store and .swap (vim temp file) etc. to a global gitignore file so I don’t have to do that per project.
Create ~/.gitignore
. Then add that path in git config.
Instructions and sample files here if you are interested GitHub - MichaelCurrin/dotfiles: Samples from my shell configs for Bash/ZSH and macOS/Linux
1 Like