Created
September 1, 2019 11:34
-
-
Save dinklebrow/26893dc64a95858064942bc0715581a0 to your computer and use it in GitHub Desktop.
Get all repos from a GIT user.
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 | |
| # Gets all the repos from a user. | |
| # Limited error checking. Well even less than that. | |
| # Orginal info taken from: | |
| # https://blog.scottlowe.org/2018/07/19/cloning-all-repositories-in-a-github-organization/ | |
| # Usage: getAllRepos.sh.sh {$USER} | |
| # E.g: getAllRepos.sh.sh dinklebrow | |
| # Set GITUSER to the first argument. | |
| GITUSER=$1 | |
| #Create User directory if not exist. | |
| if [ -d $GITUSER -a ! -h "$GITUSER" ] | |
| then | |
| echo "[*] $GITUSER Directory Exist!" | |
| else | |
| echo "[!] Directory Does not exist!." | |
| echo "[*] Creating Directory." | |
| mkdir $GITUSER | |
| fi | |
| #Lets change into the GITUSER folder. | |
| cd $GITUSER | |
| # Lets curl this bitch and put it in the new folder. | |
| curl -s https://api.github.com/users/$GITUSER/repos?per_page=200 | jq -r '.[].clone_url' | xargs -n 1 git clone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment