Created
August 24, 2013 05:47
-
-
Save rohmann/6326294 to your computer and use it in GitHub Desktop.
Clones repository and creates zip file. (repo-name-master.zip)
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/bash | |
# Usage: $ ./gitarchivemaster.sh http://url/to/repo.git dest-folder | |
url=$1 | |
name=$2 | |
#Clone repo (delete existing) | |
rm -fR ${name} | |
git clone ${url} ${name} | |
#Delete old copy | |
rm -f ${name}-master.zip | |
#pack up the zip file | |
cd ${name} | |
git archive --format zip --output ../${name}-master.zip master | |
cd .. | |
#delete the cloned repo | |
rm -fR ${name} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment