Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to handle git-submodules in git-archive

I need to pack git submodules inside of tarball which I create with git-archive.

I see that in 1.6.5 git-archive does not support git submodules.

I see several scripts to handle this case in the net, but I'm not sure which one to pick.

What is the best / most official way to do this?

like image 521
Alexander Gladysh Avatar asked Oct 19 '09 22:10

Alexander Gladysh


People also ask

Do I need git submodules?

Git submodules allow you to keep a git repository as a subdirectory of another git repository. Git submodules are simply a reference to another repository at a particular snapshot in time. Git submodules enable a Git repository to incorporate and track version history of external code.

When should I use git submodules?

In most cases, Git submodules are used when your project becomes more complex, and while your project depends on the main Git repository, you might want to keep their change history separate. Using the above as an example, the Room repository depends on the House repository, but they operate separately.

How do I manage git submodules?

Use the git submodule update command to set the submodules to the commit specified by the main repository. This means that if you pull in new changes into the submodules, you need to create a new commit in your main repository in order to track the updates of the nested submodules.

How does Git store submodules?

It is stored in Git's object database directly. The tree object for the directory where the submodule lives will have an entry for the submodule's commit (this is the so-called "gitlink").


1 Answers

You can try my script http://github.com/Kentzo/git-archive-all

EDIT:

For Mac OS X users available via homebrew: brew info git-archive-all

like image 113
Kentzo Avatar answered Oct 06 '22 14:10

Kentzo