【问题标题】:How to create private repository in Github using PyGithub如何使用 PyGithub 在 Github 中创建私有存储库
【发布时间】:2020-02-11 06:41:55
【问题描述】:

我通过这种方法想出了如何使用 PyGIthub 在 Github 上创建存储库:

import sys
from github import Github

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

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

但在这种情况下,PyGithub 会创建一个公共存储库。

如何使用 PyGithub 创建私有存储库?

【问题讨论】:

    标签: python github automation webautomation pygithub


    【解决方案1】:

    官方文档:Organization.create_repo

    您可以将private参数设置为True

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-24
      • 2018-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多