Petah
Petah

Reputation: 46050

Git submodules not pulling

I have a git repo as my master project. It has some sub-modules added to it.

It look like:

~/super_project/                <- main git repo
~/super_project/plugins/admin   <- sub-module
~/super_project/plugins/editor  <- sub-module

All that's fine, its committed and working. But when I push the super project to origin/master, and then clone it down to another machine, no sub-modules get pulled.

Ive tried git submodule init and git submodule update and git submodule update --init, they all have no effect.

Upvotes: 4

Views: 1675

Answers (1)

gforcada
gforcada

Reputation: 2558

It seems that you didn't actually pushed your submodules on your master project. Just push them.

If you clone a repository which should contain submodules but there is no .gitmodules at the root level it means that the remote server do not have them registered.

First ensure that the submodules are pushed to the server. You need to add the submodules to the parent project (just cloning or creating a repo inside another repo isn't enough).

Upvotes: 1

Related Questions