# Yet another git archive all

2 messages from 2010-11-06 to 2010-11-07. Participants: fREW Schmidt, Jakub Narebski.
Thread: https://gitlist.dev/t/25655

## fREW Schmidt, 2010-11-06 19:03

Subject: Yet another git archive all
Message-ID: <AANLkTim07Ku=ETtPEutZ_gWagXdg8kVTUMMDpZcs1kMm@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTim07Ku%3DETtPEutZ_gWagXdg8kVTUMMDpZcs1kMm%40mail.gmail.com

```
I was trying to use this:
https://github.com/meitar/git-archive-all.sh/blob/master/git-archive-all.sh

but I was having issues and am not really a bash programmer, so I
wrote a new, much more minimal archive-all.

I haven't added *any* option support, it only exports as zip, and it
does foo.zip as the file, but those things should
be pretty easy to fix for someone who cares.  Anyway, here it is!

git ls-files --cached --full-name --no-empty-directory -z | xargs -0
zip foo.zip > /dev/null
git submodule --quiet foreach --recursive 'perl -e "print join qq(\0),
map qq($path/\$_), split /\0/, qx(git ls-files -z --cached --full-name
--no-empty-directory); print qq(\0)"' | xargs -0 zip foo.zip >
/dev/null

--
fREW Schmidt
http://blog.afoolishmanifesto.com

```

## Jakub Narebski, 2010-11-07 12:00

Subject: Re: Yet another git archive all
Message-ID: <m3r5exfiop.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3r5exfiop.fsf%40localhost.localdomain
In-Reply-To: <AANLkTim07Ku=ETtPEutZ_gWagXdg8kVTUMMDpZcs1kMm@mail.gmail.com>

```
fREW Schmidt <frioux@gmail.com> writes:

> I was trying to use this:
> https://github.com/meitar/git-archive-all.sh/blob/master/git-archive-all.sh
> 
> but I was having issues and am not really a bash programmer, so I
> wrote a new, much more minimal archive-all.
> 
> I haven't added *any* option support, it only exports as zip, and it
> does foo.zip as the file, but those things should
> be pretty easy to fix for someone who cares.  Anyway, here it is!
> 
> git ls-files --cached --full-name --no-empty-directory -z | xargs -0
> zip foo.zip > /dev/null
> git submodule --quiet foreach --recursive 'perl -e "print join qq(\0),
> map qq($path/\$_), split /\0/, qx(git ls-files -z --cached --full-name
> --no-empty-directory); print qq(\0)"' | xargs -0 zip foo.zip >
> /dev/null

If you feel it is ready for wide use, could you ad information about
this project to

  https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools

Thanks in advance.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```
