On Mon, Aug 12, 2019 at 01:47:18PM +0000, Yagnatinsky, Mark wrote:
> Wait a second... suppose a file is committed with CRLF line endings.
> You're saying that even if I have autocrlf set to "input" or "auto", the file 
> will never get "converted" to LF format unless I explicitly renormalize?


> That sounds like a fairly sensible behavior, but it's not what I've observed 
> in the past at all!
> There have been plenty of times when I had "autocrlf" set to input which 
> resulted in me changing line endings on commit I had no intention of changing!
> Indeed, the whole reason I was looking at the git docs recently is that this 
> happened again and I was trying to make it stop happening!
> Or is that not what you meant?
Only changing core.autocrlf to input will not change the line endings in the 
That is intentional and allows to to keep core.autocrlf and jump force-and-back 
the history by checking out older versions or later versions.

That is why I would recommend a .gitattributes file,
which travels with the commits and through push and pull.

My feeling is that the docemntation for core.autocrlf should be:
This setting is deprecated. Use a .gitattributes file instead,
and please see the documentation.
But that is clearly debatable.

Reply via email to