Last active
December 10, 2015 05:28
-
-
Save rd2b/4387863 to your computer and use it in GitHub Desktop.
Lists gists and github repositories and clone them from the Github API.
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
# Set the user: | |
user="rd2b" | |
# Lists gists URLS: | |
curl -s https://api.github.com/users/$user/gists | sed -n 's/.*git_pull_url.*"\(.*\)".*/\1/ p' | |
# Lists github repositories: | |
curl -s https://api.github.com/users/$user/repos | sed -n 's/.*clone_url.*"\(.*\)".*/\1/ p' | |
# Clone all gists : | |
for i in ` curl -s https://api.github.com/users/$user/gists | sed -n 's/.*git_pull_url.*"\(.*\)".*/\1/ p'` | |
do | |
git clone "$i" "gist-$(basename $i)" | |
done | |
# Clone all repositories: | |
for i in `curl -s https://api.github.com/users/$user/repos | sed -n 's/.*clone_url.*"\(.*\)".*/\1/ p'` | |
do | |
git clone "$i" "github-$(basename $i)" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment