Skip to content

Instantly share code, notes, and snippets.

@madhur
Created February 12, 2017 15:39
Show Gist options
  • Save madhur/b21e142b529a958ab6413e92bca39e17 to your computer and use it in GitHub Desktop.
Save madhur/b21e142b529a958ab6413e92bca39e17 to your computer and use it in GitHub Desktop.
Bulk clone github repositories (including private)
import requests
import json
import subprocess
GITHUB_ORGANIZATION = "madhur"
ACCESS_TOKEN=""
CLONE_DIR="./"
r = requests.get("https://api.github.com/orgs/" + GITHUB_ORGANIZATION + "/repos?per_page=200&access_token=" + ACCESS_TOKEN)
data = json.loads(r.text)
for repo in data:
print repo['full_name']
p = subprocess.Popen(["git","clone", repo['clone_url']], cwd=CLONE_DIR)
p.wait()
@digitalbanana
Copy link

hi this looks great but when i try to run on windows the script just exits hgaving done nothing - any help greatly appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment