Filename too long when cloning git repository

Table of Contents

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