-
Notifications
You must be signed in to change notification settings - Fork 286
Better create_from_github() #253
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
Conversation
Fixes @215 * Clones from the ssh or https url (vs the git url), which stores the correct URL for origin remote * Better logic re: forking * Adds upstream remote in case of fork * Allows token, credentials, host to be specified
3937ef8
to
ecb8607
Compare
In particular, do this before creating a fork
#' repositories. | ||
#' Creates a new local Git repository from a repository on GitHub. It is highly | ||
#' recommended that you pre-configure or pass a GitHub personal access token | ||
#' (PAT) as described in [gh::gh_whoami()]. In particular, a PAT is required in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning to add any PAT help for this release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I plan to tackle that next.
R/create.R
Outdated
owner <- repo_info$owner$login | ||
|
||
if (is.na(fork)) { | ||
if (pat_available) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fork <- pat_available && !isTRUE(perms$push)
?
R/github.R
Outdated
#' fields with appropriate links (unless they already exist). | ||
#' `use_github()` requires that your package have a git repository, which you | ||
#' can create with [use_git()], if needed. `use_github()` then sets up | ||
#' appropriate git remotes and syncs. `use_github_links()` populates the `URL` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"remotes and syncs" ?
R/github.R
Outdated
#' public and private keys are in the default locations, `~/.ssh/id_rsa.pub` | ||
#' and `~/.ssh/id_rsa`, respectively, and that `ssh-agent` is configured to | ||
#' manage any associated passphrase. Alternatively, specify a | ||
#' [git2r::cred_ssh_key()] object via the `credentials` parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cross-link to relevant happy git with R section?
I acted on all the small comments. |
Fixes #215
create_from_github()
should share many arguments withuse_github()
Fixes #214 GitHub connectivity
I think this completes the obvious set of GitHub operations a typical user would expect. At least in terms of project initiation.
origin
remote, i.e. pull/push should now work going forwardupstream
remote in case of fork, also honouring ssh vs https protocol