Pygithub: Fourche un repo

Créé le 18 mars 2015  ·  2Commentaires  ·  Source: PyGithub/PyGithub

Je n'ai pas trouvé comment créer un dépôt, selon la page des API githubpeut être utilisé pour faire une fourchette,

Merci,

question

Commentaire le plus utile

Il existe une méthode d'utilisateur, create_fork ,

g = Github(
    os.environ["GITHUB_USER"],
    os.environ["GITHUB_PASSWORD"]
)
github_user = g.get_user()
myfork = github_user.create_fork(repo)

Tous les 2 commentaires

Il existe une méthode d'utilisateur, create_fork ,

g = Github(
    os.environ["GITHUB_USER"],
    os.environ["GITHUB_PASSWORD"]
)
github_user = g.get_user()
myfork = github_user.create_fork(repo)
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    g = Github(os.environ["username"] ,os.environ["pw"])
  File "/usr/lib/python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'username

et quand j'essaie de me connecter de base :

Traceback (most recent call last):
  File "test.py", line 5, in <module>
    myfork = github_user.create_fork("https://github.com/lyk2017-django/YilanTerbiyecisi")
  File "/usr/lib/python3.6/site-packages/github/AuthenticatedUser.py", line 452, in create_fork
    assert isinstance(repo, github.Repository.Repository), repo
AssertionError: https://github.com/lyk2017-django/YilanTerbiyecisi
Cette page vous a été utile?
0 / 5 - 0 notes

Questions connexes

diegotejadav picture diegotejadav  ·  5Commentaires

nixoz2k7 picture nixoz2k7  ·  7Commentaires

AdyaAbhra picture AdyaAbhra  ·  5Commentaires

kodeshpa picture kodeshpa  ·  3Commentaires

nchammas picture nchammas  ·  3Commentaires