FollowTheProcess/pytoil

[FEATURE] Ability to Fork and clone with `checkout`

FollowTheProcess opened this issue · 0 comments

The solution you would like

Currently pytoil checkout can only clone repos you own. However, a common workflow to work on an open source project is to fork someone else's repo, then clone your fork.

Pytoil checkout could also do this!

One possible solution:

  • If the project argument to checkout matches the form of user/repo (regex or just simple split on '/') then pytoil forks the passed repo to the user's account (POST request to the fork repo endpoint) then clones the user's fork.

We might have to sleep for a second or two to allow the fork to go through as this is done asynchronously on GitHub's end.

Once the fork is registered to the user the rest of Pytoil's functionality will work as expected.