Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal: '$GIT_DIR' too big when using CMake's FetchContent feature

Tags:

git

cmake

I'm using CMake's FetchContent feature to fetch the esp-azure repo. While doing so I got the following:

Cloning into 'C:/code/my-repo/build/_deps/espazure-src/azure-iot-sdk-c/provisioning_client/deps/utpm/deps/c-utility/deps/umock-c/deps/ctest/deps/azure-macro-utils-c'...
fatal: '$GIT_DIR' too big
fatal: clone of 'https://github.com/Azure/azure-macro-utils-c.git' into submodule path 'C:/code/my-repo/build/_deps/espazure-src/azure-iot-sdk-c/provisioning_client/deps/utpm/deps/c-utility/deps/umock-c/deps/ctest/deps/azure-macro-utils-c' failed
Failed to clone 'deps/azure-macro-utils-c'. Retry scheduled

I tried defining git config core.longpaths true but that didn't help. My guess is that the cloned repositories have their own git configs and so the parameter is overwritten.

How can I tackle this?

like image 580
galah92 Avatar asked Feb 01 '26 03:02

galah92


1 Answers

I was facing this error so I tried with the command git clone <git-repo> <short-directory-name>

And this worked for me.

Giving shorter directory name to the cloned location helped

like image 111
Nandita Avatar answered Feb 02 '26 16:02

Nandita



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!