Sling, Git, Windows and Filename Too Long

Evgeniy Fitsner Software Engineer
1 min read
Sling, Git, Windows and Filename Too Long

When working with certain projects on Windows, you may hit the following Git error:

1
error: unable to create file contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/impersonate-reverse/org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-impersonate-reverse.json: Filename too long

What Does It Mean?

By default, Git on Windows enforces a 260-character path limit due to system constraints. Not all Windows applications properly handle longer file names. This is critical when cloning projects like Apache Sling from git://git.apache.org/sling.git.

Solution

Open Windows PowerShell or CMD as administrator and execute:

1
git config --system core.longpaths true

This enables long path support, allowing file paths up to 32,767 characters.