-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy path.gitattributes
More file actions
47 lines (42 loc) · 1.17 KB
/
Copy path.gitattributes
File metadata and controls
47 lines (42 loc) · 1.17 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
47
# 统一换行符,保证跨平台构建产物字节一致。
# 背景:Windows 上 core.autocrlf=true 会把文本文件 checkout 成 CRLF,
# 前端构建(Vite)按内容哈希命名产物,换行符差异会导致同一文件哈希漂移
# (例如 workbuddy-mark SVG 在 Windows 构建后文件名变化)。
# 这里显式声明 eol=lf,优先级高于 core.autocrlf,任何平台 checkout 都是 LF。
# 默认:自动检测文本,仓库内与工作区统一 LF
* text=auto eol=lf
# 明确二进制类型,禁止任何换行符转换
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.webp binary
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary
*.otf binary
*.gz binary
*.tgz binary
*.zip binary
*.pdf binary
*.wasm binary
# SVG 是文本,保持 LF(与上面 * 规则一致,显式写出更直观)
*.svg text eol=lf
# Go / 脚本 / 配置类常见文本
*.go text eol=lf
*.mjs text eol=lf
*.js text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.css text eol=lf
*.html text eol=lf
*.json text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.sh text eol=lf
# Windows 批处理必须保持 CRLF
*.bat text eol=crlf
*.cmd text eol=crlf