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?
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.
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.
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.
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").
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With