Skip to content

Instantly share code, notes, and snippets.

@playpauseandstop
Created May 28, 2012 19:08
Show Gist options
  • Save playpauseandstop/2820717 to your computer and use it in GitHub Desktop.
Save playpauseandstop/2820717 to your computer and use it in GitHub Desktop.
Simple script to archive git repository
#!/bin/sh
#
# Simple script to archive git repository.
#
branch=HEAD
dest=`echo ~/Projects`
format=zip
prefix=`basename $(pwd)`
result=$dest/$prefix-$branch-`date "+%Y-%m-%d-%H%M%S"`.$format
git archive $branch --format=$format --prefix=$prefix/ > $result
echo "$branch of $prefix archived to $result"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment