chore: add .gitattributes to enforce LF for shell scripts and Python files

Prevents CRLF line endings on .sh files which cause '/usr/bin/env: bash\r'
errors when running on Linux.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-06-23 11:22:24 +08:00
parent ac410e7a5d
commit a629bd516c

26
.gitattributes vendored Normal file
View File

@@ -0,0 +1,26 @@
# 默认:文本文件使用 LFLinux/macOS 风格)
* text=auto eol=lf
# Shell 脚本强制 LF无论在哪个平台 checkout
*.sh text eol=lf
# Python 和 YAML 也用 LF
*.py text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.md text eol=lf
*.json text eol=lf
*.toml text eol=lf
*.txt text eol=lf
*.env text eol=lf
*.env.example text eol=lf
# Windows 脚本保留 CRLF
*.ps1 text eol=crlf
*.bat text eol=crlf
# 二进制文件不转换
*.pdf binary
*.png binary
*.jpg binary
*.csv binary