Git - Windows AND linux line-endings Git - Windows AND linux line-endings windows windows

Git - Windows AND linux line-endings


On Windows:

$ git config --global core.autocrlf true

On Linux:

$ git config --global core.autocrlf input

Read more about Dealing with line endings


Set the autocrlf to the desired value:

How autocrlf works:

core.autocrlf=true:    core.autocrlf=input:      core.autocrlf=false:       repo                     repo                    repo    /        \               /        \              /        \crlf->lf    lf->crlf     crlf->lf       \          /            \       /              \        /                \      /                \

Yet another way to show how autocrlf works

1) true:             x -> LF -> CRLF2) input:            x -> LF -> LF3) false:            x -> x -> x