My .gitignore file seems to be being ignored by Git - could the .gitignore file be corrupt? Which file format, locale or culture does Git expect?>
I just ran into this issue. The content within my .gitignore file continued to appear in the list of untracked files.
I was using this to create the ignore file:
echo "node_modules" > .gitignore
It turns out that the double quotations were causing the issue for me. I deleted the ignore file and then used the command again without quotes, and it worked as expected. I did not need to mess with the file encoding. I'm on a Windows 10 machine using Cmder.
Example:
echo node_modules > .gitignore