Skip to content

Instantly share code, notes, and snippets.

@stringparser
Created July 31, 2015 16: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 stringparser/9cc82834fb8831962c47 to your computer and use it in GitHub Desktop.
Save stringparser/9cc82834fb8831962c47 to your computer and use it in GitHub Desktop.
Clone all private repos of an organization
curl -u <token>:x-oauth-basic -s https://api.github.com/orgs/<orgName>/repos | node -e '
var repos="";
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", function(data){
repos += data;
});
process.stdin.on("end", function(){
JSON.parse(repos).forEach(function(repo){
require("child_process").spawn("git", ["clone", repo.html_url], {stdio: "inherit"});
});
})
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment