You clone a project that was created on Linux, then run git status on your Mac. A file with an umlaut in its name appears twice: deleted in one list, untracked in another. Nothing changed. Your file system and Git disagree about how to spell the same name.
Same letter, two spellings
Ü can be stored as one character (U+00DC, NFC, composed) or as U plus a combining diaeresis (U+0308, NFD, decomposed). On screen they look the same. As bytes they differ. macOS file systems have a history of using the decomposed form for names, while Linux and Windows normally keep whatever you type, usually composed. (More on this in NFC, NFD, and Japanese text.)
The fix
Tell Git to convert names that come from macOS back to composed form before comparing:
git config --global core.precomposeunicode true
If it only happens in one repository, drop --global and run it inside that repository. Then run git status again.
Make non-ASCII names readable
By default Git prints non-ASCII names in quoted octal escapes, which is how you recognize the decomposed form: "U\314\210bung.txt". The bytes \314\210 are the combining diaeresis. To print names normally:
git config --global core.quotepath false
Find names stored in decomposed form
If your repository already contains decomposed names, find them:
git ls-files -z | python3 -c "
import sys, unicodedata
for name in sys.stdin.read().split('\0'):
if name and name != unicodedata.normalize('NFC', name):
print(name)
"
For each result, rename it to the composed form on a system that preserves what you type, then commit the change. Tell your team, because the rename shows up as a change for everyone.
Prevent it
- Set
core.precomposeunicode truein your standard developer setup. - Add a CI step that fails if any tracked filename is not NFC.
- Prefer ASCII filenames in shared repositories where you can.
- Be careful with archives. ZIP files from other systems can bring decomposed names with them.
Quick checklist
- File appears as both deleted and untracked on macOS? Normalization mismatch.
git config --global core.precomposeunicode true.git config --global core.quotepath falseto read names.- Find non-NFC names with the script, rename once, commit.