Fix · GitHub and Git
Warning: LF will be replaced by CRLF
What you may see
- Git prints line ending warnings on every commit
- Every line of a file shows as changed
Most likely cause
Windows and Mac/Linux mark the end of a line differently, and Git is converting between them.
Check first (about two minutes)
- Run git diff --stat: do whole files show as changed with no real edit?
The fix prompt
What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.
Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.
Prompt language
Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.
After you tried it, did it work?
Steps
- Explain in plain words why this happens.
- Add a .gitattributes file at the top with the line * text=auto and set git config core.autocrlf appropriately for my system (ask me which one I use).
- Show me git diff --stat again to confirm only real changes remain.
Do not do this
- Do not ignore the problem if it makes every commit huge.
- Do not reformat or rewrite my files by hand.