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.


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.

链接地址: http://www.djcxy.com/p/92420.html

上一篇: 从Base64和GZIP解压缩位图

下一篇: Git:在克隆项目时子模块不会被拉动