2

I have a repo on GitHub with a submodule. The submodule directory is contained

  • in the root directory of the repo directly on github.com
  • and also in the zip that can be downloaded from github.com.

If I click on the directory on github.com, there is the expected content (of the submodule). However, in the zip, the submodule directory is empty.

How can I fix this?

It is important that people who download the root module, automatically get all the submodule content in order to be able to use it. Thank you!

Kolodez
  • 553
  • 2
  • 9
  • 1
    A submodule is a separate Git repository. It requires two `git clone` steps to get both the superproject and the submodule. Using `git clone --recursive` tells the superproject `git clone` step to run the submodule `git clone` step, but that's something the person *running* `git clone` must *request*. You can't do that for them. – torek Jun 13 '22 at 10:00

1 Answers1

3

As I mentioned before, a submodule is not included in a GitHub archive (tarball/zipfile).

You need to add to your GitHub release an artifact representing the full cloned repository (like git-archive-all.sh).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Thank you. I am not really familiar with the bash syntax. But probably, I can also create such an archive by hand and mention in the readme that people should download the release and not the GitHub archive. – Kolodez Jun 13 '22 at 10:16
  • @Kolodez Note: you can execute a bash script even on Windows, using the bash packaged with Git for Windows. – VonC Jun 13 '22 at 11:37