简体   繁体   English

如何使用 PyGithub 在 Github 中创建私有存储库

[英]How to create private repository in Github using PyGithub

I figured out how to create repository on Github using PyGIthub by this method:我想出了如何通过这种方法使用 PyGIthub 在 Github 上创建存储库:

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.但在这种情况下,PyGithub 创建了一个公共存储库。

How can I create a private repository using PyGithub?如何使用 PyGithub 创建私有存储库?

The official docs: Organization.create_repo官方文档: Organization.create_repo

You can set private parameter to True您可以将private参数设置为True

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM