Last Updated: February 25, 2016
· smoovej

Get rid of "fatal: CRLF would be replaced by LF in [file]"

This will get rid of one of my least favorite git-related error messages:

Install dos2unix

brew install dos2unix 
-- OR --
apt-get install dos2unix

Change line endings on files recursively

find  /core/sites/all/modules -type f -exec dos2unix {} +

3 Responses
Add your response

Thank you, the recursive conversion spared me many minutes of drudgery and potential misses!

over 1 year ago ·

yeah, 2nd time I write that today ... but you made my day ... or even better, evening ... after brewing dos2unix i'll have a beer now ;-)

over 1 year ago ·

If you use the fish shell, run dos2unix ** from the top level of your project and it will recursively convert all files (except for hidden files).

over 1 year ago ·