Skip to content

Commit

Permalink
super basic but working git-archive-all
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Axel 'fREW' Schmidt committed Nov 6, 2010
1 parent 9105a0a commit 075b88c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions git-archive-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Super basic tool to export repo and all submodules
# as a single zip file

# USAGE: git archive-all foo
# generates foo.zip

OUTFILE=$1

git ls-files --cached --full-name --no-empty-directory -z \
| xargs -0 zip "$OUTFILE.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 "$OUTFILE.zip" > /dev/null

0 comments on commit 075b88c

Please sign in to comment.