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:
26
.gitattributes
vendored
Normal file
26
.gitattributes
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# 默认:文本文件使用 LF(Linux/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
|
||||||
Reference in New Issue
Block a user