As soon as I clone a certain repo on my macbook pro, I immediately see files as modified in that repo. I've tried git pull, git checkout, git reset, nothing seems to make these supposedly modified files go away. I've been using git for a while and have never seen this before. What could possibly be causing it?
There is a configuration file that marks certain types of source files as text, for which newlines will be converted. There's either a .gitattributes
file in the root of the repository, or a global ~/.gitattributes
in your home directory.
You can do two things:
.gitattributes
configuration so that files aren't marked as text
anymoreI'd say that the intention was to properly let git handle newlines, so someone added the configuration in .gitattributes
after some files were committed with the Windows CRLF endlines, and when that happens, git doesn't automatically fix the existing files that were already checked out in the working tree. But a new clone will get those files into the working tree anew and automatically fix them, so git will complain next time you compare the working tree with the index.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With