Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git:Submodules are not being pulled when cloning project

I'm trying to clone on my repo from GitHub in another machine (Windows). I create a new directory and I ran the following commands in the new directory:

git init .
git remote add origin https://github.com/meme/myRepo.git
git pull origin master 
git push -u origin master

To make pull on the submodules I'm using I ran:

git pull --recurse-submodules

But nothing was showing in the submodules directory and then I ran:

git submodule update --recursive

But still nothing is showing on the submodules directory.

Any of you knows what I'm doing wrong or how can I pull the submodules files?

I'll really appreciate your help.

like image 952
user2924482 Avatar asked Apr 28 '17 18:04

user2924482


1 Answers

You can clone the submodule repos by executing this on your master repo folder

git submodule init
git submodule update

By the way, it's easier to clone the master repository with

git clone https://github.com/meme/myRepo.git .

(This will clone the repository inside the current folder)

You can also do it all in a single step:

git clone --recursive https://github.com/meme/myRepo.git FOLDER_NAME

This will clone the master repo and the submodule repos as well.

like image 173
Manuel Schmidt Avatar answered Nov 09 '22 07:11

Manuel Schmidt