A few days ago, I accidentally changed the line endings of some file, and committed the change. (Was CRLF, is now LF by mistake.) I still don't know if this was my editor being too clever, or perhaps git being too clever. (Actually I suspect it's git, based on my experiences trying to undo this.) Either way, it's done and I'd like to fix it. I thought I could just change the line endings in my editor, then do a commit with just the line ending change. Git refused, claiming I didn't change anything. So I added a dummy change as well, but it then committed the dummy change but also transformed the line endings, so they are still LF. Possibly relevant git settings:
C:\Users\ZKZ4PL2\eqs\hot-connect>git config core.eol
C:\Users\ZKZ4PL2\eqs\hot-connect>git config core.autocrlf
input
Any ideas?
First, set core.atocrlf to false, in order to avoid any automagic eol transformation by Git.
git config --global core.autocrlf false
Second, check any .gitattributes files, for core.eol directives in it.
If you have none, then changing EOL in your editor should be picked up on git add.
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