How to create a new repository in an organization with PyGithub

前端 未结 2 1861
-上瘾入骨i
-上瘾入骨i 2021-01-16 11:31

How can I create a new repository in an organization with PyGithub on Github? In particular I like to know how to use the create_repo method?

My questio

2条回答
  •  日久生厌
    2021-01-16 11:59

    This link gave me the answer: link

    I thought I would update my question to let others know what the solution was.

    Pretty simple:

    from github import Github
    
    # using username and password
    g = Github("Username", "Password")
    org = g.get_organization('orgName')
    
    repo = org.create_repo("test name")
    

提交回复
热议问题