Skip to content

Instantly share code, notes, and snippets.

@rummanwaqar
Created May 2, 2017 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rummanwaqar/741c8a5a7bd8d489abd00ef88923640f to your computer and use it in GitHub Desktop.
Save rummanwaqar/741c8a5a7bd8d489abd00ef88923640f to your computer and use it in GitHub Desktop.
Clone all github repos
function git.github.clone.organization() {
if [ $# -ne 0 ]
then
mkdir $1
cd $1
curl -s https://api.github.com/orgs/$1/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
else
echo "git.github.clone.organization <organization>"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment