error: unable to create file x: Filename too long (Windows)
Windows’ 260-character path limit blocked Git from creating a file.
Seen on:
Git
Meaning
Deep node_modules or Java package paths exceed MAX_PATH. Git for Windows supports long paths once enabled.
Common causes
- Deep directory structures
- Repo cloned in a long base path
⚡ Quick fix
- git config --global core.longpaths true
- Enable Windows long paths (LongPathsEnabled registry/Group Policy)
- Clone into a shorter path (C:\src)
Detailed fix by platform
Windows
git config --system core.longpaths true
How to diagnose
- Path — How long?
- Setting — core.longpaths?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026