In the below picture, you can see that I created a submodule from a remote repo and put it in the Submodules folder.
What I did was, I created a private repo called TestSubmodules on GitHub and then created another private repo Repo2. I added Repo2 as a submodule to TestSubmodules and as you can see, it moved Repo2 into the
SubmoduleRepo folder.
I, however, could not add a submodule to a local repository that was on my computer without a remote. (It was worth the test, for science!)
If you have a older version of Git, you may have to run the below command to get it to download the contents of the submodule:
After commiting and pushing up to GitHub, you will see this:
Cloning a repo with a submodule
When cloning a git repo with a submodule, simply cloning with git clone [path_to_git_repo] will not pull any of the submodules.
You will see a folder for your submodule but it will be empty!