Download git submodules for tarball

Can I load submodules for a repository with only a working directory?

If I download tarball from a repository from GitHub, which is equivalent to a small clone without a .git folder, is it possible to “load” submodules into the working directory at all?

I tried git init && git submodule update --init , but this does not initialize or update the submodules. The .gitmodules file is in the current directory.

Refresh . A few more questions to the question: we would like to use tarball to check the repositories on Travis CI , but several people use git submodules. "Do not use git submodules", therefore, will not be a good answer, but the answer really should not be something supported. I just want the folder in which the code was extracted, and with the initialized submodules, there is no need for anything, which will allow me to post more changes later.

+6
source share
1 answer

Combining the wget / tar method with git init will not help you initialize the submodules:

Everything is not tracked after git init .

You need to add and transfer everything before:

 git submodule update --init --recursive --force 

This git submodule will "work", but only create empty directories.
This is because the tar file did not include special entries (160000) created by git submodule add .

You need to re-declare these submodules:

 C:\prog\git\ReactiveCocoa-2.0-development>git submodule add --name xcconfigs https://github.com/jspahrsummers/xcconfigs.git external\xcconfigs Cloning into 'external\xcconfigs'... remote: Counting objects: 312, done. remote: Compressing objects: 100% (229/229), done. Receal 312 (delta 87), reused 306 (delta 82) Receiving objects: 100% (312/312), 64.51 KiB | 0 bytes/s, done. Resolving deltas: 100% (87/87), done. 
+2
source

Source: https://habr.com/ru/post/950223/


All Articles