Question

I started a git repository on a Windows machine, and then I changed to a Linux machine. Everything is working fine, but every time I commit, I get the warning warning: CRLF will be replaced by LF in [file]. I know I can set auto conversion off but, is there a command to convert all line endings into the Linux's form? I am not going to work with this project in Windows any more. Thanks in advance.

Was it helpful?

Solution

There is a dos2unix command which will change a text file from dos format (using CR LF) to unix format (using just LF). Using that, you can easily do something like

dos2unix *.c *.h
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top