diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..3558463f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,49 @@ +# 统一文本文件行尾为 LF,避免 Windows 编辑器把 LF 变 CRLF 污染 diff / git blame +* text=auto eol=lf + +# 源码类:显式标记,拒绝 autocrlf +*.java text eol=lf +*.kt text eol=lf +*.groovy text eol=lf +*.xml text eol=lf +*.yaml text eol=lf +*.yml text eol=lf +*.json text eol=lf +*.properties text eol=lf +*.md text eol=lf +*.sql text eol=lf +*.sh text eol=lf +*.py text eol=lf +*.ts text eol=lf +*.tsx text eol=lf +*.js text eol=lf +*.vue text eol=lf +*.html text eol=lf +*.css text eol=lf +*.scss text eol=lf +Jenkinsfile text eol=lf +Dockerfile text eol=lf + +# Windows 专用脚本保持 CRLF +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +# 二进制类:禁止任何转换 +*.jar binary +*.class binary +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.pdf binary +*.zip binary +*.gz binary +*.so binary +*.dll binary +*.exe binary +*.woff binary +*.woff2 binary +*.ttf binary +*.eot binary