.gitattributes and line endings

Settings for how Git handles files: line endings, binary files, diff behaviour.

Also called: CRLF, LF, line endings, core.autocrlf

Source
General

In plain English

Windows uses CRLF line endings, Mac and Linux LF. Mixing them makes every line look changed. * text=auto eol=lf keeps the repo consistent.

Example

Since adding .gitattributes, Windows line endings no longer show up as changes.

Learn more

Related terms

Added 2026-11-30 · Last reviewed 2026-11-30