1. .gitattributes

* text=auto eol=lf
*.sh text eol=lf
*.bat text eol=crlf

2. Git 全局配置

# 禁止Git自动转换换行符(信任.gitattributes)
git config --global core.autocrlf false
# 启用大小写敏感(避免不同系统文件命名冲突)
git config --global core.ignorecase false
# 允许长路径(Windows重要设置)
git config --global core.longpaths true

3. .gitignore

# 系统文件
.DS_Store      # macOS
Thumbs.db      # Windows
desktop.ini    # Windows

# 编辑器配置
.vscode/
.idea/

# 开发环境文件
.env
.env.local

# 后端依赖
vendor/
*.exe
bin/

# 前端依赖
node_modules/
dist/