Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork a repo #302

Closed
ahmad88me opened this issue Mar 18, 2015 · 2 comments
Closed

Fork a repo #302

ahmad88me opened this issue Mar 18, 2015 · 2 comments
Labels

Comments

@ahmad88me
Copy link

I couldn't find how to fork a repo, according to github APIs page <POST /repos/:owner/:repo/forks> can be used to do a fork,

thanks,

@skyl
Copy link

skyl commented Jun 19, 2015

There is a method of user, create_fork,

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

@ghost
Copy link

ghost commented Jul 29, 2017

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

and when i try to just basic login:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants