vguzmanp
vguzmanp

Reputation: 825

How can I migrate a git repo from Windows to Linux? (CRLF - LF issue)

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.

Upvotes: 2

Views: 1272

Answers (1)

Vaughn Cato
Vaughn Cato

Reputation: 64308

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

Upvotes: 3

Related Questions