Created
May 10, 2011 22:03
-
-
Save timabell/965475 to your computer and use it in GitHub Desktop.
create git tarballs easily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -z "$1" ] | |
then | |
rev="HEAD" | |
else | |
rev=$1 | |
fi | |
wd=`pwd` | |
basepath=`basename $wd` | |
desc=$(git describe --always "$rev") | |
prefix="$basepath-$desc" | |
echo "creating archive $prefix.tar.gz..." | |
git archive --format=tar --prefix="$prefix/" "$rev" | gzip > "$prefix.tar.gz" | |
echo "done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment