簡體   English   中英

是否可以添加帶有遞歸標志的git子模塊?

[英]Is it possible to add a git submodule with recursive flag?

我在我的項目中添加了一個子模塊,其中包含另一個git repo。

要獲取我運行的模塊:

git submodule add git://github.com/biakaveron/debug-toolbar.git modules/debug-toolbar

然后運行:

git submodule update --init --recursive

哪個產生此錯誤:

fatal: Not a git repository: ../../../../../../..//d/websites/project/.git/modules/modules/debug-toolbar/modules/vendor/firephp
Failed to recurse into submodule path 'modules/debug-toolbar'

我以前也遇到過類似的問題。 以前,我只是添加了子模塊,然后使用有效的遞歸標記( git clone --recursive project.git )重新克隆了該項目。 但是,如果我可以首先讓子模塊以遞歸方式插入,那會更容易。 有沒有辦法做到這一點?

可能的原因可能是github.com/cadorn/firephp-libs提到以下事實:

此項目已移至以下存儲庫:

https://github.com/firephp/firephp
https://github.com/firephp/firephp-core

因此,您可能想先更新debug-toolbar.gitmodules文件(在git submodule update --init ,不帶--recursive部分), 然后再次嘗試git submodule update --init --recursive

OP做了:

提交,然后遞歸克隆-奏效。


原始答案:

似乎其中一個子模塊(在.gitmodules文件中 )的路徑定義不正確:
作為相對路徑,當由git submodule --recursive命令從父存儲庫執行克隆/更新時,該相對路徑無效,它不會成功解析。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM