Skip to content

Instantly share code, notes, and snippets.

@victorvhpg
Last active August 29, 2015 14:10
Show Gist options
  • Save victorvhpg/33889d0611905780e253 to your computer and use it in GitHub Desktop.
Save victorvhpg/33889d0611905780e253 to your computer and use it in GitHub Desktop.
Clonar todos os repositorios publicos de um usuário - github
#!/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