Created
July 30, 2015 21:01
-
-
Save sarajmunjal/c0e49a50378dac83663b to your computer and use it in GitHub Desktop.
Helps to clone all repos in your organisation. Useful for setting up, or maybe backing up the universe on your last day at work :) Insert values for organisation, username, password.
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 requests_oauthlib | |
import os | |
from requests_oauthlib import OAuth1 | |
organisation = "<org_name>" | |
username = "<username>" | |
password = "<your_password>" | |
url = "https://api.github.com/orgs/" + organisation + "/repos" | |
auth = (username,password) | |
r = requests.get(url,auth=auth) | |
res = r.json() | |
for obj in res: | |
clone_url = obj.get('clone_url'); | |
print "Now cloning " + clone_url | |
os.system("git clone "+clone_url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment