I am learning Ruby on Rails and I use Windows 7. When I try to commit my changes to Git, I receive the fatal: LF would be replaced by CRLF
message.
It seems that rails generate
generates files with LF, not CRLF. Of course, I may switch from
git config --global core.autocrlf true
git config --global core.safecrlf true
to
git config --global core.autocrlf true
git config --global core.safecrlf warn
but I don't like the possibility of crushing any committed binary into pieces.
I tried to avoid the problem with .gitattributes
, but my lines like
* text=auto
*.rb text
do not help.
Is there a way to make Rails generate files with CRLF ending? Or is there a way to make Git auto-transform the .rb
and .erb
files, but not others?