Last active
April 5, 2018 07:13
-
-
Save kevalpatel2106/f0eea38bbb357ceb51842717c5b91333 to your computer and use it in GitHub Desktop.
Clone all the repo from Github.
This file contains 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 | |
echo "Enter the access key. Tou can generate access key from \"https://github.com/settings/tokens\".:" | |
read ACCESS_TOKEN | |
echo "Enter to host url of the GitHub: (e.g. github.com)" | |
read GITHUB_INSTANCE | |
echo "Enter to the page number: (Script will download 100 repos per page.)" | |
read PAGE | |
echo "Gtihub username:" | |
read USERNAME | |
CNTX="user" | |
curl -H "Authorization: token ${ACCESS_TOKEN}" "https://api.${GITHUB_INSTANCE}/$CNTX/repos?type=owner&page=$PAGE&per_page=100" | | |
grep -e 'clone_url*' | | |
cut -d \" -f 4 | | |
sed "s/${GITHUB_INSTANCE}/${USERNAME}@${GITHUB_INSTANCE}/g" | | |
xargs -L1 git clone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment