14

I've a submodule inside of my git Github repository and I've created a release of it.

My repository has this kind of structure (very classic) :

repo_A (main repository)
  dir_A.1
  dir_A.2 (submodule)
  dir_A.3

But when I download the release, there is nothing inside of "dir_A.2".

Is there any way to add the dir_A.2 files to the release archive ?

For a very specific reason, I need them at the download time, not after (I'm building a debian package and the tool is checking that the archive corresponds to the unpacked files).

The Github support answered me :

This is not possible currently. Thanks for the suggestion though! I have added it to our list for our team to consider.

cooow
  • 748
  • 11
  • 29
  • By "downloading the release", do you mean a tarball or zipball archive as in https://developer.github.com/v3/repos/contents/#get-archive-link? – VonC Jan 11 '16 at 11:19
  • Yes, I use "uscan --force-download" to download the tarball archive. And uscan use the following regex to download the last tarball archive : https://github.com/corentindesfarges/fw4spl/releases .*/archive/(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz) – cooow Jan 11 '16 at 11:48
  • I mentioned it, because to my knowledge, submodules are never included in the tarball archive. – VonC Jan 11 '16 at 11:59

2 Answers2

14

A GitHub tarball archive (API Content) never includes the submodules, to my knownledge.

A submodule can point to any git repo (like another gitHub repo, but a private one, or a git repo not accessible from GitHub).

You have scripts like this one which allows to build a git archive of everything (parent repo andsubmodules), but that would require a git clone --recursive first.

The OP cooow confirms in the comments:

The Github support answered me :

This is not possible currently.
Thanks for the suggestion though! I have added it to our list for our team to consider.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Indeed the Github support answered me : " This is not possible currently. Thanks for the suggestion though! I have added it to our list for our team to consider. " – cooow Jan 11 '16 at 13:06
  • 1
    @cooow I thought so: I have included your comment to the answer for more visibility. – VonC Jan 11 '16 at 13:07
  • @cooow don't forget to read http://stackoverflow.com/help/why-vote and http://stackoverflow.com/help/accepted-answer – VonC Jan 11 '16 at 13:09
  • *A submodule can point to any git repo (like another gitHub repo, but a private one, or a git repo not accessible from GitHub).* this is not a valid argument. If it can be visible on Github, it is not private. – unalignedmemoryaccess Mar 02 '21 at 12:56
  • @tilz0R a submodule is just a reference to another repository. The reference is visible to GitHub, the actual remote repository referenced might be *not* visible from Github. – VonC Mar 02 '21 at 13:01
  • @VonC this I agree, still it could try to fetch it. HTTP well defines error codes. – unalignedmemoryaccess Mar 02 '21 at 13:02
-2

When you download a project with submodules the content of the submodules are not checkout automatically so you will have to checkout explicitly.

You have to init and update your sub-module after the clone

# got to the folder directory
cd project

# init the submodules folder and download the code
git submodule update --init --recursive
CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • Yes but as I have said, the debian packaging tool doesn't accept any change on the source code after have downloaded the archive... – cooow Jan 11 '16 at 11:09
  • 1
    and a release does not include the .git folder and so the command does not work even if the .gitmodules file is included (which it is) but ya could download source instead of release and then do that – Rakka Rage Mar 28 '20 at 22:02