Git submodules not updating?

Posted by DavidYell on Stack Overflow See other posts from Stack Overflow or by DavidYell
Published on 2012-05-01T19:45:55Z Indexed on 2013/10/30 9:54 UTC
Read the original article Hit count: 281

Filed under:

I have a project in which I've included some libraries as submodules. They work fine on the machine that you add them on, but when I get home and checkout the repo, I get the folders for the submodules but they are empty.

.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

Config and status commands

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

I added these as you would normally with,
git submodule add <repo> <path>
git submodule init

The submodules are hosted on Github and my repo is hosted on Bitbucket, although I'm not sure if this is relevant.

© Stack Overflow or respective owner

Related posts about git