Created
May 8, 2020 22:37
-
-
Save thieu1995/9111eca3ba6aef5550d8a3e9b0c2a487 to your computer and use it in GitHub Desktop.
Download all public github's repository of a specific user
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 | |
# Clone all github.com repositories for a specified user. | |
if [ $# -eq 0 ] | |
then | |
echo "Usage: $0 <user_name> " | |
exit; | |
fi | |
USER=$1 | |
# clone all repositories for user specifed | |
for repo in `curl -s https://api.github.com/users/$USER/repos?per_page=1000 |grep git_url |awk '{print $2}'| sed 's/"\(.*\)",/\1/'`;do | |
git clone $repo; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment