Git Can Track Two Files Your Mac Cannot Check Out
说明与用途
casecrash 检测因大小写差异和 Unicode 正规化导致的文件名冲突,防止 macOS 和 Windows 上的工作树出现错误,帮助开发者提前重命名文件。
问题
Git tracks two files that macOS cannot check out due to case‑sensitivity and Unicode normalization differences, causing permanently dirty working trees and failed updates.
结果
casecrash detects and reports filename collisions caused by case differences and Unicode normalization, enabling preemptive renaming and ensuring clean working trees on case‑insensitive filesystems.
工作流
- Clone or pull the repository on macOS or Windows
- Run
casecrashto scan for case and Unicode collisions - Review the output and rename any colliding files using
git mv - Commit the renames and push the changes
证据
Git can track two files your Mac cannot check out.
Hermes Agent issue #99821: the repo tracks contributors/emails/[email protected] alongside a twin file whose name differs only by capitalization.
On Linux both files live happily side by side. On a Mac, every clone or pull ends up with a permanently dirty working tree — and hermes update on macOS flat-out refuses to update past it.
So I built casecrash: a tiny zero-dependency Python CLI that automates that one-liner for both collision classes — casefolding and Unicode normalization — and reports exactly which pairs break, and on which platforms.
casecrash: found 2 filename collision(s) in /tmp/demorepo (5 files scanned): [normalization] collide after Unicode normalization (macOS): 'cafe\u0301.md' [NFD] 'caf\u00e9.md' [NFC] -> breaks on: macOS [case] collide on case-insensitive filesystems (macOS, Windows): 'README.md' 'readme.md' -> breaks on: macOS, Windows Fix: rename one of each colliding pair before a macOS/Windows user clones this repo.
It's CI-friendly by design: exit 1 when collisions are found, 0 when clean, 2 on errors.
- 记录日期: 2026-10-03T08:41:10.847Z