I\'m using Ubuntu 13.10 x64, and I am working on a project that some developers are using Windows , I recently changed the git config core.eol to \"lf\" and
I'm on a Mac using Terminal and had this problem with an .htaccess file I was trying to commit, getting the fatal error:
fatal: CRLF would be replaced by LF in .htaccess
I wanted to fix the problem, like the OP requests, not just turn off a git flag, so I found this article that gives a perl command to fix the problem on a per file basis.
perl -pi -e 's/\r\n/\n/g' input.file
So for my .htaccess error above, I ran the following:
perl -pi -e 's/\r\n/\n/g' .htaccess
The flags -p, -i and -e (pie) can be combined to allow you to edit files using Perl from the command line. In this case replacing all \r\n found with \n.