ProjectStack
git

warning: LF will be replaced by CRLF

Git is warning you that it will convert Unix-style line endings (LF) to Windows-style (CRLF) when checking out files. This is controlled by the core.autocrlf setting and usually harmless but can cause noise in diffs.

Common causes

  • core.autocrlf is set to true on Windows, which converts line endings on checkout
  • The repository has files with LF line endings and you're on a Windows system
  • A .gitattributes file is missing or doesn't specify line ending rules
  • Mixing contributors on Windows and Unix/Mac systems without a shared line ending policy

How to fix it

  1. For cross-platform repos, set: git config --global core.autocrlf input (Mac/Linux) or git config --global core.autocrlf true (Windows)
  2. To suppress just this warning: git config --global core.safecrlf false
  3. Add a .gitattributes file to enforce consistent line endings: * text=auto
  4. This is usually just a warning — your files will work correctly

Example

warning: LF will be replaced by CRLF in src/index.js. The file will have its original line endings in your working directory.

Running git add on a Windows machine with core.autocrlf=true

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.