git config_warning ai_generated true

warning: LF will be replaced by CRLF

ID: git/crlf-warning

Also available as: JSON · Markdown
95%Fix Rate
95%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

Line ending mismatch. Harmless warning but can cause noise in diffs.

generic

Workarounds

  1. 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

  2. 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:

  1. Disable core.autocrlf entirely 55% fail

    May cause issues when collaborating across OS platforms

  2. Convert all files manually 65% fail

    Tedious and error-prone — use .gitattributes instead

Error Chain

Frequently confused with: