Created
February 12, 2017 15:39
-
-
Save madhur/b21e142b529a958ab6413e92bca39e17 to your computer and use it in GitHub Desktop.
Bulk clone github repositories (including private)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi this looks great but when i try to run on windows the script just exits hgaving done nothing - any help greatly appreciated