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>\

Leave a Reply

Your email address will not be published. Required fields are marked *