# EOL LF Windows auto.crlf issue

2 messages from 2017-06-24 to 2017-06-24. Participants: Filip Kucharczyk, Torsten Bögershausen.
Thread: https://gitlist.dev/t/46248

## Filip Kucharczyk, 2017-06-24 16:56

Subject: EOL LF Windows auto.crlf issue
Message-ID: <CADtLFZcQNziGJx-aW9pvUU-NTHcbRN8pHXecMtRgaYwqTjGZWQ@mail.gmail.com>
URL: https://gitlist.dev/e/CADtLFZcQNziGJx-aW9pvUU-NTHcbRN8pHXecMtRgaYwqTjGZWQ%40mail.gmail.com

```
I'm on Windows 10.
auto.crlf in .gitconfig is set to
[core]
autocrlf = true
I've got a git (git version 2.13.1.windows.2) repo.
A linux guy emails me a text with with line endings LF.
I paste this file into my repo.
Now every time I introduce changes to this file and stage it, git tell me:
"warning: LF will be replaced by CRLF in a.txt.
The file will have its original line endings in your working directory."
But when I commit the file git does not replace anyline endings - they
stay LF in the commited file and in my working direcotry.
I'm sort of misleaded by this message.

Filip

```

## Torsten Bögershausen, 2017-06-24 22:02

Subject: Re: EOL LF Windows auto.crlf issue
Message-ID: <9825c435-d752-79b5-f474-964f1ded8c54@web.de>
URL: https://gitlist.dev/e/9825c435-d752-79b5-f474-964f1ded8c54%40web.de
In-Reply-To: <CADtLFZcQNziGJx-aW9pvUU-NTHcbRN8pHXecMtRgaYwqTjGZWQ@mail.gmail.com>

```


On 24/06/17 18:56, Filip Kucharczyk wrote:
> I'm on Windows 10.
> auto.crlf in .gitconfig is set to
> [core]
> autocrlf = true
> I've got a git (git version 2.13.1.windows.2) repo.
> A linux guy emails me a text with with line endings LF.
> I paste this file into my repo.
> Now every time I introduce changes to this file and stage it, git tell me:
> "warning: LF will be replaced by CRLF in a.txt.

This conversion will happen if you do
rm a.txt
git checkout a.txt

After these 2 steps, the file willhave CRLF in the working tree,
see below.
But if you don't, the file stays as it is in the working tree.

> The file will have its original line endings in your working directory."

> But when I commit the file git does not replace anyline endings - they
> stay LF in the commited file and in my working direcotry.

Yes, core.autocrlf=true tells Git that they should have CRLF in the working 
tree, at least after a clean checkout.
> I'm sort of misleaded by this message.
Suggestions how to improve things are of course welcome -
for your case it may help to set
git config core.autocrlf input
for this very repo.

> 
> Filip
> 

```
