Conversation
| gistURL = ghinstance.GistPrefix(hostname) + gistURL | ||
| } | ||
|
|
||
| _, err := git.RunClone(gistURL, opts.GitArgs) |
There was a problem hiding this comment.
The repo clone command sets the upstream repository of a fork automatically on clone so I tried to do this for the gist clone command as well.
However, it looks like while the gist GraphQL Object can tell if its a fork or not, it doesn't have any link to the parent gist.
pkg/cmd/gist/clone/clone.go
Outdated
|
|
||
| if !git.IsURL(gistURL) { | ||
| hostname := ghinstance.OverridableDefault() | ||
| gistURL = ghinstance.GistPrefix(hostname) + gistURL |
There was a problem hiding this comment.
I didn't add the protocol here because it would have required changes on the ghrepo.FromFullName function and cloning worked without it but happy to do that if required!
vilmibm
left a comment
There was a problem hiding this comment.
thank you for this! I tested it out locally and it worked well~
I'd love for this command to respect the git_protocol setting. I have mine set for ssh but the origin remote on my clone used https; could you try adding support for that? I'm happy to help if it's unclear how to do so or if any of the supporting functions need refactoring.
|
Thanks for the review @vilmibm -- makes total sense! I'll try to make the requested changes on the weekend and report back then! |
This adds the ability to clone a gist. Usage: ```sh $ gh gist clone 5b0e0062eb8e9654adad7bb1d81cc75f $ gh gist clone https://gist.github.com/OWNER/5b0e0062eb8e9654adad7bb1d81cc75f ``` This closes cli#2115.
|
Updated to take |
This adds the ability to clone a gist, very similar to the
repo clonecommand.Usage:
This closes #2115.