Check the line endings on your .gitignore file. In an OS X repo, mine was using CR line endings. Everything worked again after switching over to LFs.
perl -p -e 's/\r/\n/g' < .gitignore > .gitignore-new
mv .gitignore-new .gitignore
Console jockeys will likely want to use sed
instead.
Background: I had copied my working copy from a Windows repository after a power failure.