forked from urzeye/tampermonkey-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitattributes
More file actions
46 lines (42 loc) · 1.74 KB
/
.gitattributes
File metadata and controls
46 lines (42 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# =======================================================
# 核心规则:自动处理
# =======================================================
# 1. Git 会自动检测文件是否为文本。
# 2. 如果是文本:提交到仓库时强制转为 LF。
# 3. 检出到本地时:Windows 转为 CRLF,Mac/Linux 保持 LF。
* text=auto
# =======================================================
# 强制 LF (适用于必须在 Linux/Unix 环境运行的脚本)
# =======================================================
# 即使在 Windows 上开发,这些文件检出时也必须是 LF,
# 否则在 Docker 或 Linux 服务器上运行会报 "Command not found" 错误。
*.sh text eol=lf
*.bash text eol=lf
*.zsh text eol=lf
# =======================================================
# 强制 CRLF (适用于 Windows 专用脚本)
# =======================================================
# 这些文件必须保留 Windows 格式,否则 CMD 可能无法执行。
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# =======================================================
# 二进制文件 (严禁转换换行符)
# =======================================================
# 防止 Git 误将二进制文件当成文本处理导致文件损坏。
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
# =======================================================
# 特定语言/IDE 配置文件 (通常建议强制 LF)
# =======================================================
# 现代编辑器(VS Code, IntelliJ, etc)在 Windows 上都能完美处理 LF。
# 强制统一为 LF 可以彻底避免 diff 时的换行符干扰。
*.js text eol=lf
*.json text eol=lf
*.css text eol=lf
*.md text eol=lf
.editorconfig text eol=lf
.gitignore text eol=lf