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 question is identical to this question, but I would like the created repository to appear in an organization.
The solution to creating a repo without the organization level is:
g = Github("username", "password")
user = g.get_user()
repo = user.create_repo(full_name)
Below code will help you to create new Repo in an organization:
using username and password establish connection to github:
If you are using Github Enterprise then use below code to login:
create the new repository:
full code to create a Repo:
Clone a repo :
push code to repo:
Full code to clone,create and push to a repo:
This link gave me the answer: link
I thought I would update my question to let others know what the solution was.
Pretty simple: