Sample from .gitattributes file that was recently committed.
* text=auto eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ahk text eol=crlf
*.ps1 text eol=lf
Current output of git ls-files --eol below. Note that file a.ps1 is currently a newly created staged file and file b.ps1 was added in a previous commit when *.ps1 text eol=crlf existed in the .gitattributes file.
i/lf w/lf attr/text eol=crlf a.ps1
i/lf w/crlf attr/text eol=crlf b.ps1
Expected output of git ls-files --eol below
i/lf w/lf attr/text eol=lf a.ps1
i/lf w/lf attr/text eol=lf b.ps1
I can correct the w/ line ending to lf by just manually changing the local files, but why does it not say attr/text eol=lf?
Does someone happen to know what is happening? OS is windows, if that matters. Thanks for your time.
I found a solution, although at this time I am not sure what really happened.
I use git submodules. Top level git repo A had submodule B; B is the repo mentioned in this question. There was a file
A/.git/modules/B/info/attributesthat was an older version of myB/.gitattributesfile. Deleting this old file allowedB/.gitattributesto be utilized and forattr/text eol=lfto be set appropriately fora.ps1andb.ps1.