| 用途 | 减少空白差异导致的冲突 |
|---|---|
| 语法 | git merge -X ignore-space-change <分支> |
| 变体 | -X ignore-all-space 更激进 |
常用示例
常用示例
git merge -X ignore-space-change feature/format
git merge -X ignore-all-space feature/indent从根源治理
从根源治理
# 仓库根放 .gitattributes 统一行尾
printf '*.text eol=lf
*.sh text eol=lf
' > .gitattributes忽略空白只影响冲突判断,不改变内容;合并后运行格式化工具复核,别让空白策略掩盖真实逻辑改动。