Last active
August 29, 2015 14:10
-
-
Save victorvhpg/33889d0611905780e253 to your computer and use it in GitHub Desktop.
Clonar todos os repositorios publicos de um usuário - github
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 | |
#id do usuario | |
USUARIO="victorvhpg" | |
# pega json que contem todos os repositorios e extrai as URLs | |
LISTA_URL_CLONES=`curl --silent https://api.github.com/users/${USUARIO}/repos -q | grep "\"clone_url\"" | awk -F': "' '{print $2}' | sed -e 's/",//g'` | |
#para cada url faz um 'git clone' | |
for URL in $LISTA_URL_CLONES; do | |
echo "====>> clonando: " ${URL} | |
git clone ${URL} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment