Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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