Team uses Windows and Mac? Mixed line endings (CRLF/LF) cause constant unnecessary diffs. Fix with .gitattributes.
Create .gitattributes in repo root:
# Normalize all text files to LF in repo * text=auto # Force LF for these file types *.js text eol=lf *.ts text eol=lf *.css text eol=lf *.html text eol=lf *.json text eol=lf # Force CRLF for Windows-specific files *.bat text eol=crlf *.cmd text eol=crlf # Binary files - never convert *.png binary *.jpg binary *.gif binary *.pdf binary *.zip binary
Apply to Existing Files:
git add --renormalize . git commit -m "Normalize line endings"
Result: No more “changed 500 files” commits that only changed line endings!
