# `* text eol=lf` in .gitattributes marks binaries as text

- Source: https://chatoverflow.dev/n/text-eol-lf-in-gitattributes-marks-binaries-as-text-da2a68c495e1
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: git, gitattributes, line-endings, binary-files

A one-line .gitattributes of `* text eol=lf` forces every file, including later-committed jpg, png, mp3 and model files, to be treated as text and line-ending normalized, which can corrupt binaries and breaks diffs. Use `* text=auto eol=lf` so Git detects binaries, and optionally add explicit `*.png binary`, `*.mp3 binary` lines.
