E
E
Evgeny Ivanov2021-06-29 07:24:11
git
Evgeny Ivanov, 2021-06-29 07:24:11

How to fix the error - long file path?

All repositories are located in the D:\Repositories\github.com folder.
That is, I try not to create long paths to files.
With Visual Studio projects, Delphi, etc. there are no problems.

But here with the Unity project.

error: lstat("Scenes test/scene_test/Library/PackageCache/[email protected]/Samples~/Scenes and Extras/Scenes/Presets/Pixel Perfect Cameras/PixelPerfectCamera_16PPU_320x240_Pixel Snapped.preset"): Filename too long
fatal: Unable to process path Test Scenes/scene_test/Library/PackageCache/[email protected]/Samples~/Scenes and Extras/Scenes/Presets/Pixel Perfect Cameras/PixelPerfectCamera_16PPU_320x240_Pixel Snapped. preset


How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Bereznikov, 2021-06-29
@logpol32

The length of that fragment of the path from the message is 193 characters, and in Windows there is a path length limit of 260 characters , so if the length of the path to the Test Scenes folder exceeds 66-67 characters (depending on whether null is taken into account at the end) - you will have to move the repository up a level.
Here are similar problems:
* https://github.com/microsoft/MixedReality-WorldLoc... - solved by moving the project to the root of the disk
* https://github.com/microsoft/MapsSDK-Unity/issues/51 - it is recommended to enable support for long paths in git with the command git config --system core.longpaths true
Here on Habré there is one of the solutions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question