Filename too long when cloning git repository

Symptom

When cloning a git repository to a Windows PC, “File name too long” was shown in checking out step.

Cause

Windows system limited the file path to 260 characters

Solution

Option 1: Config git to use long file path in Windows system by below command:

git config --system core.longpaths true

Option 2: Update the config file (.gitconfig) as below

[core]
 longpaths = true

Normally, the .gitconfig file is in C:\Users\<your username>’

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

Back to Top