简体   繁体   English

致命:使用 CMake 的 FetchContent 功能时“$GIT_DIR”太大

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

I'm using CMake's FetchContent feature to fetch the esp-azure repo.我正在使用 CMake 的 FetchContent 功能来获取esp-azure 存储库。 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.我尝试定义git config core.longpaths true但这没有帮助。 My guess is that the cloned repositories have their own git configs and so the parameter is overwritten.我的猜测是克隆的存储库有自己的 git 配置,因此参数被覆盖。

How can I tackle this?我该如何解决这个问题?

I was facing this error so I tried with the command git clone <git-repo> <short-directory-name>我遇到了这个错误,所以我尝试使用命令git clone <git-repo> <short-directory-name>

And this worked for me.这对我有用。

Giving shorter directory name to the cloned location helped为克隆位置提供较短的目录名称有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 git:获取有效的GIT_DIR,如果当前目录是工作树子目录并且未设置$ GIT_DIR - git: get effective GIT_DIR, if current dir is a working tree subdir and $GIT_DIR is unset GIT_DIR 如何工作? 确切地 - How does GIT_DIR work? Exactly 如何在 VS Code 中设置 GIT_DIR? - How to set GIT_DIR in VS Code? 如何在维护多个存储库时设置GIT_DIR和GIT_WORK_TREE - How to set GIT_DIR & GIT_WORK_TREE when maintaining multiple repositories CMake FetchContent 仅用于 git 子目录 - CMake FetchContent for just a git subdirectory Git 错误“致命:GIT_WORK_TREE(或 --work-tree=<directory> ) 不允许不指定 GIT_DIR (或 --git-dir=<directory> )” - Git error "fatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>)" 使用$ GIT_DIR环境变量或--git-dir标志在同一目录中运行多个git repos是个坏主意吗? - Is it a bad idea to run multiple git repos in the same directory using the $GIT_DIR environment variable or --git-dir flag? Git命令查看活动的GIT_DIR在哪里 - Git command to see where is the active GIT_DIR 如何通过在 $GIT_DIR/branches 中命名文件来在 git 中定义远程 - How to define a remote in git by naming a file in $GIT_DIR/branches Git :: Repository:使用未初始化的值$ git_dir - Git::Repository: use of uninitialized value $git_dir
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM