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 submodule
s 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
.gitmodules
file, but nogitlink
objects.GitHub displays proper submodules with a grey folder icon, which is absent from this repository:
Since the faulty
.gitmodules
file only contains a single entry, in your case I recommenddeleting the
.gitmodules
file,adding the submodule properly,
and committing.
The output from
git commit
should showPointInCircle
being added with mode160000
(indicating agitlink
), and your repository should now be properly configured. Usegit submodule status
to 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.