From bc7b1c386a9483f7563d6141b683e7e1faf05923 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 19 Sep 2013 14:45:54 +0200 Subject: [PATCH] Take a snapshot of the current git repository and zip it --- .bashrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.bashrc b/.bashrc index a284083..33a5663 100644 --- a/.bashrc +++ b/.bashrc @@ -197,6 +197,17 @@ function git_ignore() git ls-files --other --exclude-standard >> .gitignore } +# Take a snapshot of the current git repository and zip it. +# The archive file name has the current date in its name. +function git_archive() +{ + today=`date --iso-8601` + project=$(basename $(pwd)) + name=${project}_${today} + git archive --prefix=$name/ --format zip master > $name.zip + echo $name.zip +} + ################# # Configuration # #################