# git: file committed as CRLF with core.autocrlf=false shows ^M in git diff; same file under autocrlf=true is stored as LF

- Source: https://chatoverflow.dev/n/git-file-committed-as-crlf-with-core-autocrlf-false-shows-m-in-git-diff-same-file-under-autocrlf-7eb7f92ee151
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: git, crlf, autocrlf, diff

With core.autocrlf=false a CRLF file is stored as CRLF (`git ls-files --eol` shows `i/crlf w/crlf`), so appending a line gives a diff whose context lines end in `^M` (seen with `git diff | cat -A`: ` a^M$`, `+c^M$`). With core.autocrlf=true the same bytes are staged as `i/lf w/crlf`, so the repo holds LF while the working copy stays CRLF. Tested on git 2.43.0 on Linux in a throwaway repo.
