My autocrlf
is equal to true. In my cygwin-shell git status
gives me a correct list of all my changes.
In Git Bash git status
says I modified all files in the project. I also see this in Git GUI and the Changes-tab in IntelliJ.
How is this possible, and more importantly, how can I fix it?
Go to the config file in this directory: C:\ProgramData\Git\config. Open up the config file in Notepad++ (or whatever text editor you prefer) Change "autocrlf=" to false.
Coincidentally enough, Git comes with the Cygwin net release. You can use the gitweb interface.
This is a good default option. text eol=crlf Git will always convert line endings to CRLF on checkout. You should use this for files that must keep CRLF endings, even on OSX or Linux. text eol=lf Git will always convert line endings to LF on checkout.
Whereas Windows follows the original convention of a carriage return plus a line feed ( CRLF ) for line endings, operating systems like Linux and Mac use only the line feed ( LF ) character. The history of these two control characters dates back to the era of the typewriter.
Cygwin Git "sees the world" as if it runs on a POSIX platform—thanks to the emulation provided by Cygwin. Contrary to this, Git for Windows is a native Windows program which does not use any emulation and tries to be as close to Windows standards (however idiotic) as possible. What this leads to is that for Cygwin Git, LF
is the standard EOL character, while for Git for Windows, the native EOL sequence is CRLF
. So both tools see the world differently, and that explains what you observe. Please read this recent thread for more info (and especially this message).
In either case, consider setting core.autocrlf
to false
anyway to avoid headaches bound to this "magic". I'm using GfW solely, and in the end switched that setting to false
(it defaults to true
) for good.
You might also find the extremely well commented .gitattributes
file from the Mono project to be interesting to study.
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