git for-each-ref --format='git archive --format=tar.gz --output="%(refname:lstrip=-1).tar.gz" --prefix="test-repo/" %(refname)' refs/heads/
##### Output
git archive --format=tar.gz --output="master.tar.gz" --prefix="test-repo/" refs/heads/master
git archive --format=tar.gz --output="second.tar.gz" --prefix="test-repo/" refs/heads/second
# hooks/post_update

echo "this is a test"
echo "this is a test" >>updatelog1
echo "this is a 2nd test" | tee updatelog2
echo "cool info: $@" | tee updatelog
echo "first arg: $1"
echo "second arg: $2"
echo "third arg: $3"
exec git update-server-info
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 4 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 1.76 KiB | 1.76 MiB/s, done.
Total 6 (delta 2), reused 0 (delta 0), pack-reused 0
remote: this is a test
remote: this is a 2nd test
remote: cool info: refs/heads/master refs/heads/second
remote: first arg: refs/heads/master
remote: second arg: refs/heads/second
remote: third arg: 
To ssh://alphamethyl.barr0w.net/home/barrow/public_html/test-repo/
   0d172bd..a982cb9  master -> master
 * [new branch]      second -> second