I have a Git repository (originally CVS, then SVN, now Git) containing a Rails project that has been deployed on Linux for a while now. Everything seems to run fine.
<A comment to davitenio's answer and Daniel Beardsley's comment; I believe you could use this little program as a wrapper around dos2unix:
#!/bin/sh
for f in $@; do
if [ $(file -b -n -i -m /dev/null $f | grep -c "text") -gt 0 ]; then
dos2unix $f
fi
done
although there is probably still some corner case that will fail.
If it is ok for you to rewrite your repository's history (see problems with rewriting history) you could use git filter-branch to convert CRLF to LF:
git filter-branch --tree-filter 'find . -path './.git' -prune -o -type f -exec dos2unix \{} \;' HEAD
Note that if you have binary files in your repository you will have to refine the find command to exclude them.