-
Notifications
You must be signed in to change notification settings - Fork 37
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
github forks #30
Comments
I've ran into this as well. I like your proposal, but I'm unsure how to know if something is a fork. I would probably have to call out to some kind of tool to detect it. I would also like to figure out how to manage the remotes when you're in a forked repo. I do it differently each time and haven't settled on a consistent workflow that works for me. |
I believe that forks are managed via the websites (Github, Gitlab, Bitbucket, etc) and not by git itself. If you want to implement with api requests Github is pretty straight forward.
Gitlab is a little more difficult,
I can lookup bitbucket or other websites if this info is helpful. Lastly, if you have a Github project and you want it to check Gitlab or Bitbucket automagically. This app may need to guess that the same username exists for those different websites and fail gracefully. Let me know if this helps. |
#36 may give some start for this feature. |
#38 PR partially deals with this issue. |
If you are on a repo that is a fork. Get all the forks using github api:
|
These commands works pretty well, curl -s 'https://api.github.com/repos/ahazem/gh' | \
python -c "import sys, json; print json.load(sys.stdin)['parent']['forks_url']" expected result: curl -s 'https://api.github.com/repos/ahazem/gh' | \
python -c "import sys, json; print json.load(sys.stdin)['parent']['html_url']" expected result: |
I often have repos with multiple remotes corresponding to forks on github.
It would be nice if
gh
had a sensible way to deal with that.I can think of a couple ideas, e.g., if you
gh foo bar
when github.com/foo/bar is a fork of github.com/fu/bar which is already gh'ed, then create a symlink and do agit remote add fu xxx; git fetch fu
. Or maybe do this only after user confirmation?As a generalization, it would be nice to be able to
gh-forks
a repo and have it cloned with all forks added as remotes, and to be able to update this when new forks are created.The text was updated successfully, but these errors were encountered: