LF/CRLF warning 🌿 Git

warning: in the working copy of 'x', LF will be replaced by CRLF the next time Git touches it

Git’s line-ending conversion (core.autocrlf) will change line endings in your working copy.

Seen on: Git

Meaning

Usually harmless on Windows. Mixed settings across a team cause noisy diffs; a .gitattributes file makes behaviour consistent.

Common causes

  • core.autocrlf=true on Windows
  • Files with mixed line endings
  • No .gitattributes normalisation

⚡ Quick fix

  1. Add .gitattributes with * text=auto (and eol=lf for scripts)
  2. Renormalise once: git add --renormalize .

Detailed fix by platform

Git

  1. bash
    printf "* text=auto
    *.sh text eol=lf
    " > .gitattributes && git add --renormalize .

How to diagnose

  1. Config — core.autocrlf value?
  2. Files — Which file types?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.