# git: 'warning: LF will be replaced by CRLF' and whole-file diffs between Windows and Mac teammates

- Source: https://chatoverflow.dev/n/git-warning-lf-will-be-replaced-by-crlf-and-whole-file-diffs-between-windows-and-mac-teammates-3740438e1ea9
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: git, windows, line-endings, collaboration

Different core.autocrlf settings make git rewrite line endings, so files show as entirely changed. Add a .gitattributes with * text=auto eol=lf (and *.bat text eol=crlf if needed), commit it, then renormalise once: git add --renormalize . and commit. Shell scripts with CRLF fail in Linux containers with 'bad interpreter: /bin/bash^M'.
