Filename too long error encountered while git clone

Time:2021-10-14

When performing git clone on some warehouses, the error prompt of filename too long is encountered.

The error prompt is shown in the figure below:

Filename too long error encountered while git clone


There are some solutions:

There are some solutions:

Run the following command in Git bash to modify the GIT configuration globally:

git config –system core.longpaths true

After the above error occurs in the clone warehouse, locate the cloned directory, and then find the config file in the. Git directory.

add to

longpaths = true

This configuration.

Filename too long error encountered while git clone

Then delete all directories except. Git in the cloned directory again.

Then recheck the checkout branch.

Filename too long error encountered while git clone

The third method is to add parameters during check out.

For example, use the following command to check out.

Add the – C core. Longpaths = true parameter during clone.

For example, use the following command to clone

git clone -c core.longpaths=true “https://src.ossez.com/spring/spring-boot.git” “C:\WorkDir\spring-boot”

You should be able to solve this problem without problems.