Interview Prep/Git & GitHub/Config, Line Endings, Files and Platform Quirks

Cloning on Windows fails with `error: unable to create file src/very/deep/.../component.test.ts: Filename too long`.

BeginnerTroubleshootingConfig, Line Endings, Files and Platform Quirks
Answer

Likely causes → Windows' legacy 260-character MAX_PATH limit. Deep node_modules-style paths plus a long clone directory exceed it.

Diagnose → git config --show-origin core.longpaths

Fix →

git config --global core.longpaths true
# also allow long paths in Windows (admin PowerShell):
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name LongPathsEnabled -Value 1 -PropertyType DWORD -Force

Then re-run the checkout: git restore --source=HEAD :/ or clone again. Cloning into a short path (C:\src\app) also helps.

Prevent → Keep repository paths reasonably shallow and include core.longpaths in the Windows dev setup.

All Git & GitHub questions Roadmap: Git & GitHub

More on Config, Line Endings, Files and Platform Quirks