In one of my git repository, I have added the following .gitattribute
file to regulate LF/CRLF characters:
*.bat text eol=crlf
*.cmd text eol=crlf
*.java text eol=lf
*.scala text eol=lf
*.xml text eol=lf
*.py text eol=lf
*.R text eol=lf
# mimicking apache spark
To test its effect, I manually change the line separator of one bat
file from CRLF to LF, unfortunately, when committing & pushing this change in git, it is accepted despite obviously violating the new .gitattribute
:
How could it be possible? Is it a bug in git?