I've faced some unclear behavior of how GIT manages line endings. There are a bunch of *.sh
files in my repository. Line endings are inconsistent: some have CRLF
line endings while others have LF
line endings. When I refreshed repository by rm .git\index
and git reset
all *.sh
files marked as changed. I've inverted line endings manually for some of these *.sh
files and refreshed repository, but these files still considered as changed by git status
.
I've tried this with different combinations of autocrlf
and .gitattribute
settings:
autocrlf=true
- *.sh text eol=lf
autocrlf=true
- *.sh eol=lf
autocrlf=false
- *.sh text eol=lf
autocrlf=false
- *.sh eol=lf
Why are none of these forced LF
line endings for *.sh
files and all files remains changed despite of line endings type?