22

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.

3
  • By "downloading the release", do you mean a tarball or zipball archive as in developer.github.com/v3/repos/contents/#get-archive-link? Commented Jan 11, 2016 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 : github.com/corentindesfarges/fw4spl/releases .*/archive/(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz) Commented Jan 11, 2016 at 11:48
  • I mentioned it, because to my knowledge, submodules are never included in the tarball archive. Commented Jan 11, 2016 at 11:59

2 Answers 2

18

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.

Sign up to request clarification or add additional context in comments.

6 Comments

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 I thought so: I have included your comment to the answer for more visibility.
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.
@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.
|
-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 

2 Comments

Yes but as I have said, the debian packaging tool doesn't accept any change on the source code after have downloaded the archive...
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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.