Last active
December 12, 2017 22:36
-
-
Save chbrandt/233a3116e2e6b6fd05c5ccd8d1dc01a0 to your computer and use it in GitHub Desktop.
Download all 'user' repositories from github
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
# Get the list of (<100) repositories from user 'fulano' from github | |
# Using curl, goes like: | |
#$ curl https://api.github.com/users/fulano/repos?per_page=100 > github_repos.json | |
# | |
import subprocess | |
with open('github_repos.json','r') as fp: | |
import json | |
repos = json.load(fp) | |
for r in repos: | |
if not os.path.isdir(r['name']): | |
proc = subprocess.Popen(['git','clone',r['ssh_url']]) | |
output = proc.communicate() | |
else: | |
print('Repository {} already cloned'.format(r['name'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment