我有一個項目,其中包含一些庫作爲子模塊。他們在你添加它們的機器上工作得很好,但是當我回到家並簽出回購時,我得到了子模塊的文件夾,但它們是空的。Git子模塊沒有更新?
.gitmodules
[email protected] /cygdrive/c/xampp/htdocs/learning-lithium
$ cat .gitmodules
[submodule "libraries/lithium"]
path = libraries/lithium
url = git://github.com/UnionOfRAD/lithium.git
[submodule "app/webroot/css/elements"]
path = app/webroot/css/elements
url = https://github.com/dmitryf/elements.git
[submodule "app/libraries/li3_markdown"]
path = app/libraries/li3_markdown
url = https://github.com/sandelius/li3_markdown.git
[submodule "app/webroot/markitup"]
path = app/webroot/markitup
url = https://github.com/markitup/1.x.git
配置和狀態命令
[email protected] /cygdrive/c/xampp/htdocs/learning-lithium
$ git submodule
-af14f48b419310935446176290e1f9dc641400e0 app/libraries/li3_markdown
-ebdcd8ca09c874f5e2ef81ec198cc441f37a4f74 app/webroot/css/elements
-328291e49a3c7e1fb76b3342f112734864836205 app/webroot/markitup
-4980010526d05c556c496ff63951da31828c5943 libraries/lithium
[email protected] /cygdrive/c/xampp/htdocs/learning-lithium
$ git submodule update
[email protected] /cygdrive/c/xampp/htdocs/learning-lithium
$ git submodule status
-af14f48b419310935446176290e1f9dc641400e0 app/libraries/li3_markdown
-ebdcd8ca09c874f5e2ef81ec198cc441f37a4f74 app/webroot/css/elements
-328291e49a3c7e1fb76b3342f112734864836205 app/webroot/markitup
-4980010526d05c556c496ff63951da31828c5943 libraries/lithium
我說這些,你通常會用,
git submodule add <repo> <path>
git submodule init
子模塊託管在Github上,我的回購託管在Bitbucket上,儘管我不確定這是否相關。
不知道這是否會有所幫助,但是您是否嘗試過使用--recursive選項進行克隆? – kevin628
@ kevin628工程!你能否將它形成一個答案,我會標記爲已接受。 –
剛發佈的答案! – kevin628