I'd like to clone a git repo [1], which has a submodule defined in .gitmodules:
[submodule "PointInCircle"]
path = PointInCircle
url = https://github.com/midas-journal/midas-journal-843
Following these questions [2-4], I tried:
$ git clone --recursive https://github.com/midas-journal/midas-journal-851
If I understand submodules correctly, which I obviously don't, there should be a directory inside midas-journal-851 called PointInCircle with the second repo cloned into it. However, no PointInCircle directory is created and as far as I can tell the code isn't cloned anywhere. For good measure, I also tried...
$ git submodule init
$ git submodule update
...as well as...
$ git submodule update --init --recursive
...and...
$ git submodule foreach --recursive git submodule update --init
...in the cloned directory. Each command runs without printing anything to the console, and I don't see any changes in the directory.
Any ideas what I'm doing wrong?
[1] https://github.com/midas-journal/midas-journal-851
[2] Cloning a git repo with all submodules
[3] How to `git clone` including submodules?
[4] 'git submodule update --init --recursive' VS 'git submodule foreach --recursive git submodule update --init'
You're not doing anything wrong. That repository's submodule is only partially configured.
Submodules are defined by two things:
This repository contains a
.gitmodulesfile, but nogitlinkobjects.GitHub displays proper submodules with a grey folder icon, which is absent from this repository:
Since the faulty
.gitmodulesfile only contains a single entry, in your case I recommenddeleting the
.gitmodulesfile,adding the submodule properly,
and committing.
The output from
git commitshould showPointInCirclebeing added with mode160000(indicating agitlink), and your repository should now be properly configured. Usegit submodule statusto be sure:You might want to open a pull request to the parent repository with your fix, but since it only contains a single commit from three years ago I suspect that it is abandoned.