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 had this same problem. I believe the issue was a CR vs. CR+LF discrepancy. I stashed things in my .gitignore using CMD (on Windows 7) and the following command:
Bad:
echo "file_to_be_ignored.py" >> .gitignore
echo "*~" >> .gitignore
Etc.
The issue was that this command does not place the correct end-of-line marker for Git to recognize the newlines (either CR or CR+LF when Git expects the other). I solved the problem by manually replacing each newline in Vim (Vim to the rescue!) and it worked perfectly.
Try editing your .gitignore in Notepad++ or Vim (ideally). Even if the file looks like it's formatted correctly, try replacing the newlines. It sounds weird, I know, but it worked for me. :D