I\'m trying to put a submodule into a repo. The problem is that when I clone the parent repo, the submodule folder is entirely empty.
Is there any way to make it so
You can use this command to clone your repo with all the submodules:
git clone --recursive YOUR-GIT-REPO-URL
Or if you have already cloned the project, you can use:
git submodule init
git submodule update
late answer
// git CLONE INCLUDE-SUBMODULES ADDRESS DESTINATION-DIRECTORY
git clone --recursive https://USERNAME@bitbucket.org/USERNAME/REPO.git DESTINATION_DIR
As I just spent a whole hour fiddling around with a friend: Even if you have Admin rights on BitBucket, always clone the ORIGINAL repository and use the password of the one who owns the repo. Annoying to find out that you ran into this minetrap :P
If it is a new project simply you can do like this :
$ git clone --recurse-submodules https://github.com/chaconinc/YourProjectName
If it is already installed than :
$ cd YourProjectName (for the cases you are not at right directory)
$ git submodule init
$ git submodule update
After cloning the parent repo (which contained some submodule repo), do as the following:
git submodule update --init --recursive
Try this for including submodules in git repository.
git clone -b <branch_name> --recursive <remote> <directory>
or
git clone --recurse-submodules
Try this:
git clone --recurse-submodules
It automatically pulls in the submodule data assuming you have already added the submodules to the parent project.