chore: 添加.gitattributes规范行尾符处理

- 设置text=auto自动检测文本文件
- 为常见源代码文件指定LF行尾符
- 解决Windows/WSL环境切换时的行尾符差异问题
This commit is contained in:
fmq
2026-06-06 15:27:47 +08:00
parent 554b5418ee
commit 4932a87fc1
5 changed files with 51 additions and 4 deletions
+39
View File
@@ -0,0 +1,39 @@
# Auto detect text files and perform LF normalization
* text=auto
# Explicitly declare text files
*.rs text eol=lf
*.py text eol=lf
*.md text eol=lf
*.toml text eol=lf
*.json text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
# Declare files that will always have CRLF line endings on checkout
*.sln text eol=crlf
# Denote all files that are truly binary and should not be modified
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.flac binary
*.jar binary
*.war binary
*.nar binary
*.ear binary
*.zip binary
*.tar binary
*.gz binary
*.xz binary
*.bz2 binary
*.7z binary
*.pdf binary
*.docx binary
*.xlsx binary
*.pptx binary