When I do git status
I see this:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: project/schema-readme.md
modified: project/vp-automate.php
Strange thing is that those two files are not actually modified - they are binary the same, byte by byte.
Now I think I know why they are marked as modified by Git: it's because they use CRLF line endings while our project recently added a .gitattributes
file with this content:
* text=auto eol=lf
This should mean that when committed, they will be actually updated by Git to have LF line endings. Is that why git status
is marking those files as "modified" even though they are not currently modified?
EDIT: this is strange, there are many more files in my project that use CRLF line endings and are not detected as modified.. I don't understand what's so special about schema-readme.md
and vp-automate.php
that Git detects them as modified.