Filename too long 🌿 Git

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

  1. git config --global core.longpaths true
  2. Enable Windows long paths (LongPathsEnabled registry/Group Policy)
  3. Clone into a shorter path (C:\src)

Detailed fix by platform

Windows

  1. git config --system core.longpaths true

How to diagnose

  1. Path — How long?
  2. 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.