I'm not sure what I'm doing wrong in this case with my .gitignore file, but these files keep showing up.
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:
.gitignore
file.git rm -r --cached .
_site
and .sass-cache
foldersgit add .
and git status
showed that the working directory was cleanDespite 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.
The .gitignore in its current state can be found here.
The solution: To fix this error, you may either add the untracked files to your Git repository (as advised by the warning message) or add them to your . gitignore file. After that, either option should allow the git pull to succeed.
Untracked files are the ones still not versioned—”tracked”—by Git. This is the state of new files you add to your repository. That basically means Git is aware the file exists, but still hasn't saved it in its internal database.
By default, git clean will only remove untracked files that are not ignored. Any file that matches a pattern in your . gitignore or other ignore files will not be removed. If you want to remove those files too, you can add a -x to the clean command.
Your .gitignore
file is currently detected as UTF-16LE encoded. Changing encoding to UTF-8 is the solution.
To fix:
Encoding
menu) to UTF-8 without BOMgit commit -m "fixed ignore file"
At this point, the ignore file should start working correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With