Template
- 新增 .gitattributes:* text=auto eol=lf + 二进制白名单,策略落在仓库层而非本机 core.autocrlf - 新增 .editorconfig:编辑器侧强制 utf-8 / LF / 末尾空行 - 背景:本机 core.autocrlf=true 且仓库无声明,出现 diff 为空却恒显 modified 的幻影脏文件(ENG-001) - 已 renormalize 全库,索引与工作区均为 LF
51 lines
1.1 KiB
Plaintext
51 lines
1.1 KiB
Plaintext
# 换行符策略:在仓库层声明,不依赖任何机器本地的 core.autocrlf(ENG-001)
|
||
# 入库经 clean 过滤归一为 LF、检出保持 LF;避免"diff 为空却恒显 modified"的幻影脏文件。
|
||
* text=auto eol=lf
|
||
|
||
# 文本文件显式声明(覆盖 text=auto 的猜测)
|
||
*.ets text eol=lf
|
||
*.ts text eol=lf
|
||
*.js text eol=lf
|
||
*.mjs text eol=lf
|
||
*.cjs text eol=lf
|
||
*.json text eol=lf
|
||
*.json5 text eol=lf
|
||
*.md text eol=lf
|
||
*.ps1 text eol=lf
|
||
*.sh text eol=lf
|
||
*.yml text eol=lf
|
||
*.yaml text eol=lf
|
||
*.xml text eol=lf
|
||
*.txt text eol=lf
|
||
*.svg text eol=lf
|
||
*.gitignore text eol=lf
|
||
*.gitattributes text eol=lf
|
||
*.editorconfig text eol=lf
|
||
|
||
# 二进制白名单(禁止任何换行转换)
|
||
*.png binary
|
||
*.jpg binary
|
||
*.jpeg binary
|
||
*.gif binary
|
||
*.webp binary
|
||
*.ico binary
|
||
*.bmp binary
|
||
*.ttf binary
|
||
*.otf binary
|
||
*.woff binary
|
||
*.woff2 binary
|
||
*.so binary
|
||
*.a binary
|
||
*.hap binary
|
||
*.app binary
|
||
*.har binary
|
||
*.hsp binary
|
||
*.zip binary
|
||
*.gz binary
|
||
*.7z binary
|
||
*.db binary
|
||
*.mp4 binary
|
||
*.mp3 binary
|
||
*.wav binary
|
||
*.jar binary
|