Clone all github repos of an organization

sometimes you need just everything at once

Posted on September 19, 2014

Clone all repos of an organization

During the live coding session of Nico, I needed to get all content of Instead of cloning every repository on its own, I used this gist.

And because it is such a nice feature, I wrapped it in a function:

function git.github.clone.organization() {
    if [ $# -ne 0 ]
        mkdir $1
        cd $1
        curl -s$1/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load( { |repo| %x[git clone #{repo["ssh_url"]} ]}'
        echo "git.github.clone.organization <organization>"

Thanks, caniszczyk!