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?>
All the answers here are actually workarounds. You need to create the .gitignore file before you run git init. Otherwise git will never know you need to ignore those files, because they have been tracked already.
echo .idea/ >> .gitignore
git init
If you develop on a daily basis, I advise you to add your habitual ignored files to your ~/.gitignore_global file. That way, git will already know which files you (meaning "your user", since it's a file in your home directory) usually ignore.