Skip to content

Instantly share code, notes, and snippets.

@nisevi
Created July 19, 2020 23:41
Show Gist options
  • Save nisevi/a7a08fa3e63ce9b0f75c8b97e4a7faf1 to your computer and use it in GitHub Desktop.
Save nisevi/a7a08fa3e63ce9b0f75c8b97e4a7faf1 to your computer and use it in GitHub Desktop.
Clone all repositories from a given Organization
import os
from github import Github
g = Github("token-goes-here")
org = g.get_organization("organization-name-goes-here")
repos = org.get_repos()
for repo in repos:
cmd = "git clone {}".format(repo.ssh_url)
print("Starting to clone {}".format(repo.name))
print("Running command '{}'".format(cmd))
os.system(cmd)
print("Finshed cloning {}".format(repo.name))
print("#####################################")
print("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment