14

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.

gtux
  • 538
  • 3
  • 15
user2924482
  • 8,380
  • 23
  • 89
  • 173
  • 1
    Possible duplicate of [How to \`git clone\` including submodules?](http://stackoverflow.com/questions/3796927/how-to-git-clone-including-submodules) – jonrsharpe Apr 28 '17 at 18:45

1 Answers1

27

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.

Manuel Schmidt
  • 2,178
  • 2
  • 15
  • 19
  • I'm not trying to clone submodule. I had add the submodule to my repo already. I'm clone my repo in another computer. – user2924482 Apr 28 '17 at 19:41
  • Right, you want to have the content of your submodule folders filled. This is actually cloning those repos (a submodule is actually another git repo). If you prefer, you can replace _clone_ the submodules in my answer by _getting_ the content of those submodules – Manuel Schmidt Apr 28 '17 at 19:49