# Git 换行符策略:文本文件统一以 LF 入库(Git 规范存储),源码检出强制 LF。 # 作用: # - 消除 Windows core.autocrlf=true 下反复出现的 "LF will be replaced by CRLF" 警告; # - 保证 Linux 服务器部署时 PHP/HTML/JS/CSS 行尾一致(CRLF 在部分环境会引发问题)。 # 说明:.gitattributes 优先级高于 core.autocrlf;二进制文件显式声明,避免被误判为文本。 * text=auto # 源码/文本文件强制 LF 检出 *.php text eol=lf *.html text eol=lf *.js text eol=lf *.css text eol=lf *.json text eol=lf *.sql text eol=lf *.md text eol=lf *.xml text eol=lf *.ini text eol=lf *.stub text eol=lf *.txt text eol=lf *.example text eol=lf # 二进制文件(图片等) *.ico binary *.png binary *.jpg binary *.jpeg binary *.gif binary *.webp binary *.zip binary *.woff binary *.woff2 binary *.ttf binary