1

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?

Harun Yilmaz
  • 8,281
  • 3
  • 24
  • 35

1 Answers1

3

The official docs: Organization.create_repo

You can set private parameter to True

repo = user.create_repo(folderName, private=True)
Harun Yilmaz
  • 8,281
  • 3
  • 24
  • 35