git
config_warning
ai_generated
true
warning: LF will be replaced by CRLF
ID: git/crlf-warning
95%Fix Rate
95%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2 | active | — | — | — |
Root Cause
Line ending mismatch. Harmless warning but can cause noise in diffs.
genericWorkarounds
-
95% success Create .gitattributes with line ending rules for your project
* text=auto *.sh text eol=lf *.bat text eol=crlf
Sources: https://git-scm.com/docs/gitattributes#_end_of_line_conversion
-
88% success Set core.autocrlf=input on Linux/Mac or =true on Windows
git config --global core.autocrlf input
Sources: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf
Dead Ends
Common approaches that don't work:
-
Disable core.autocrlf entirely
55% fail
May cause issues when collaborating across OS platforms
-
Convert all files manually
65% fail
Tedious and error-prone — use .gitattributes instead
Error Chain
Frequently confused with: