我有一个项目,其中包含一些库作为子模块。它们在您添加它们的机器上运行良好,但是当我回到家并检查存储库时,我得到了子模块的文件夹,但它们是空的。
.gitmodules
Neon@Neon-PC /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
配置和状态命令
Neon@Neon-PC /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
Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium
$ git submodule update
Neon@Neon-PC /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 上,我的 repo 托管在 Bitbucket 上,尽管我不确定这是否相关。