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
- For cross-platform repos, set: git config --global core.autocrlf input (Mac/Linux) or git config --global core.autocrlf true (Windows)
- To suppress just this warning: git config --global core.safecrlf false
- Add a .gitattributes file to enforce consistent line endings: * text=auto
- 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.
