The symptom
What you see
$ warning: in the working copy of 'src/app.js', LF will be replaced by CRLF
$ the next time Git touches it - The warnings show in the Output panel (Git channel)
- The status bar (bottom-right) shows CRLF or LF for the open file
This is Git's message, not commands to run. Older Git prints the shorter 'warning: LF will be replaced by CRLF in src/app.js'.
What it means
Every line of a text file ends with an invisible character — and the two worlds disagree about which one. Windows ends lines with CRLF ("carriage return + line feed"); Mac and Linux use just LF. Git is warning you that it plans to normalize the endings so that you and a teammate on a different system don't constantly see phantom changes in each other's files.
Is anything wrong? No.
It's a warning, not an error. Your code runs identically either way, the commit succeeds, and nothing is corrupted. The only real annoyance line endings ever cause is cosmetic: a diff that claims every line of a file changed when you only edited one (see the tip below).
The set-and-forget fix
Tell Git your preference once
$ git config --global core.autocrlf true # Windows
$ # Mac/Linux use: git config --global core.autocrlf input - The status-bar CRLF/LF indicator converts the open file when clicked
- The Files: Eol setting controls what new files use
autocrlf true = store LF in the repo, give you CRLF on disk. The warnings quiet down once files are consistent.
Team-proof it: .gitattributes
Your core.autocrlf setting lives on your machine. To make the whole
team consistent regardless of their settings, commit a one-line
.gitattributes file at the repo root:
.gitattributes
$ * text=auto - Explorer → New File → name it
.gitattributes - Paste the line, save, commit it like any file
File contents for a .gitattributes file — not commands. It tells Git to normalize all text files for everyone.
Tip: a diff showing every line of a file as changed is almost always line endings, not real edits. Normalize the file (save it once with the right ending) and the diff shrinks back to your actual change.
Up next: your branch says master, every tutorial says main — the four-command rename.