Git lf-will-be-replaced-by-crlf Git warns that LF line endings will become CRLF on a file next rewrite.

dev@local: ~/project — git
dev@local~/project$git status
error: lf will be replaced by crlf
Diagnostics Translation
Git warns that LF line endings will become CRLF on a file next rewrite.
waiting for resolution...
LowVersion Control System

Reviewed for reference consistency: August 11, 2026

Code is Safe

SECURE

Git has paused the operation to protect your code. No data has been lost or corrupted.

What To Know

This warning means the file's line endings disagree with the configured conversion policy — the command worked, and the ending fix is deferred to the next time Git rewrites the file.

Where Did It Fail?

Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
Git halted to protect the uncommitted files in your active working directory.

Commands That Trigger This

A checkout produced LF endings, then core.autocrlf was turned on
A file created with Unix endings on Windows is staged for the first time
Cross-platform teams commit the same repository with different autocrlf settings

Technical Background

01

The message is a policy notice, not a failure: the command succeeded, and the ending conversion is scheduled for whenever Git next rewrites the file. Nothing is lost — under autocrlf the repository-side content stays LF, and the warning simply says the two views will be reconciled.

02

It becomes noisy when the policy itself is inconsistent — half the team converts, half does not — or when renormalization was skipped after a .gitattributes change. The documented resolution runs through aligning the policy (autocrlf plus attributes) and renormalizing once, not through silencing individual warnings.

Underlying Causes

core.autocrlf=true (or input) disagrees with the file's current endings
A .gitattributes eol rule changed without renormalizing the files
Files were checked out before the line-ending policy was configured
Editors or tools rewrote files with endings the policy does not expect

Frequently Asked Questions

No. The conversion happens the next time Git rewrites the file, not during the current command; the working copy keeps its current bytes meanwhile.

Yes — the check runs when files are staged or added, so brand-new files with LF endings trigger it under a CRLF policy.

Related Git States