Aryansh Mahato
Aryansh Mahato

Reputation: 51

How to create private repository in Github using PyGithub

I figured out how to create repository on Github using PyGIthub by this method:

import sys
from github import Github

g = Github('AryanshMahato', 'GITHUB_PASSWORD')

user = g.get_user()
repo = user.create_repo(folderName)

But in this case PyGithub creates a public repository.

How can I create a private repository using PyGithub?

Upvotes: 1

Views: 914

Answers (1)

Harun Yilmaz
Harun Yilmaz

Reputation: 8558

The official docs: Organization.create_repo

You can set private parameter to True

repo = user.create_repo(folderName, private=True)

Upvotes: 3

Related Questions