chore(.gitattributes): 完善Git属性配置规范换行符与二进制文件处理——核心目的是解决拉取源代码 docker compose部署的时候的报错:stock-server | exec /usr/local/bin/docker-entrypoint.sh: no such file or directory (#1488)

为shell脚本、Dockerfile、Makefile和.env文件强制配置LF换行符,将证书密钥类二进制文件标记为binary以避免Git修改其编码
This commit is contained in:
Heluojiang
2026-05-27 21:43:00 +08:00
committed by GitHub
parent a13863e50e
commit 5afe11c39f

22
.gitattributes vendored
View File

@@ -19,3 +19,25 @@ docs/assets/**/*.jpg binary
docs/assets/**/*.jpeg binary
docs/assets/**/*.png binary
docs/assets/**/*.psd binary
# === 强制 LF 的文件类型(内核/系统解释器直接消费) ===
# Shell 脚本entrypoint.sh、任何 .sh
*.sh text eol=lf
*.bash text eol=lf
# Dockerfile包括多阶段或变体
Dockerfile text eol=lf
Dockerfile.* text eol=lf
# Makefile
Makefile text eol=lf
# 环境变量文件(如果被 shell 直接 source 使用)
.env text eol=lf
# === 新增:二进制文件(禁止 Git 修改换行/编码) ===
# 证书、密钥等(如果有)
*.pem binary
*.crt binary
*.key binary
*.p12 binary