Skip to content

Instantly share code, notes, and snippets.

@rrajendran
Last active January 8, 2019 11:35
Show Gist options
  • Save rrajendran/69b2ebf4203491d4b8da2fecb24e572e to your computer and use it in GitHub Desktop.
Save rrajendran/69b2ebf4203491d4b8da2fecb24e572e to your computer and use it in GitHub Desktop.
Python script to make all repos in the github private
from github import Github
# or using an access token
g = Github("<token>")
# Then play with your Github objects:
for repo in g.get_user().get_repos():
repo_details = g.get_repo(repo.id)
if not repo_details.fork:
repo_details.edit(private=True)
print(str(repo_details.name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment