Git 在 Windows 克隆的时候提示错误 Filename too long

从 GitHub 克隆一个项目下发出现了错误:

error: unable to create file spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksCanOverrideDefaultParametersCompilerFlag.gradle: Filename too long

Git 可以创建 4096 长度的文件名,然而在 windows 最多是260。

因此有时候在项目中你可能会遇到文件名过长的问题。

可以执行下面的命令进行全局修改:

git config --global core.longpaths true

然后再次执行克隆,就可以避免这个长文件名的问题了。