Skip to content

Instantly share code, notes, and snippets.

@chaoslogick
Created July 23, 2016 00:43
Show Gist options
  • Save chaoslogick/8411ce03913de10f02e51875de034beb to your computer and use it in GitHub Desktop.
Save chaoslogick/8411ce03913de10f02e51875de034beb to your computer and use it in GitHub Desktop.
BASH: Clone all user's github repos
#!/bin/bash
if [ -z "$1" ]
then
echo "No arguments supplied"
else
curl -u michaelperrygoodman -s https://api.github.com/users/$1/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment