Skip to content
meitar edited this page Sep 12, 2010 · 10 revisions

Welcome to the git-archive-all.sh wiki!

git-archive-all.sh is a simple bash shell script that runs git-archive in the current directory, then finds all git submodules beneath the current working directory and runs git-archive for each of them, too. By default, the utility will then create one “super archive” of the entire directory hierarchy.

Most options available in git-archive supported. See below for details.

How to use git-archive-all.sh

The following sections are a pseudo-manual. The most up-to-date information is always available by running

git-archive-all.sh --help

Synopsis

Options

Examples

The simplest use of this script is:

cd $GIT_DIR; git-archive-all.sh

where $GIT_DIR is your superproject’s root directory. This will create a single .tar file in the current directory named after the current directory. That is, if your superproject directory is called “super” it creates a file called “super.tar”.

If you want your superproject and submodules to be archived in individual files, simply pass --separate or -s to the script.

cd $GIT_DIR; git-archive-all.sh --separate

This will create the aforementioned “super.tar” file. Assuming you have a submodule at the path dir1/sub1, you will also see a file in the current directory called “dir1.sub1.tar”.

Caveats

Since different submodules may be at different commits, git-archive-all.sh always supposes you want the HEAD of the superproject and all its submodules. That is, there is no provision to provide git-archive-all.sh with a different tree-ish parameter to pass along to git-archive. This might cause surprise if your submodule’s working copy is different from its HEAD.

Clone this wiki locally