Skip to content

Instantly share code, notes, and snippets.

@banunatina
Last active December 15, 2016 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save banunatina/bc9bfe83bd078830a69a to your computer and use it in GitHub Desktop.
Save banunatina/bc9bfe83bd078830a69a to your computer and use it in GitHub Desktop.
Batch Clone

This script will batch clone all repos retrieved from a RESOURCEURL into the current directory that you're in.

This will prompt you for your github password.

Example Resource URLS:

https://api.github.com/user/repos

https://api.github.com/orgs/[ORGNAME]/repos?page=[PAGENUMBER]

I recommend storing this as a zsh or bash alias (i.e batch-clone ($1)) where $1 is the RESOURCE URL

curl -u[USERNAMEHERE] -s [RESOURCEURL] | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["url"]} ]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment