Skip to content

Instantly share code, notes, and snippets.

@wzdiyb
Last active September 3, 2020 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wzdiyb/6b230f17b9032d5007dd7be89d8cc40d to your computer and use it in GitHub Desktop.
Save wzdiyb/6b230f17b9032d5007dd7be89d8cc40d to your computer and use it in GitHub Desktop.
Download Github Repos as zip
#!/bin/bash
# Zip Directory
zip_dir='PATH' # Absolute/Relative Path
cd $zip_dir
# Timestamp
timestamp=$(date +%Y%m%d-%H%M%S)
mkdir $timestamp
cd $timestamp
# Download
for rep in $(cat $zip_dir/list); do
#git clone rep
echo "Downloading: " $rep
url=$rep
rep_name=$(echo $rep | cut -d '/' -f 5)
curl -L -H "Authorization: token <token>" $url/archive/master.zip > $rep_name.zip
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment