Skip to content

Commit bd449af

Browse files
committed
Work on docs re: GitHub setup
1 parent a9943da commit bd449af

File tree

4 files changed

+40
-10
lines changed

4 files changed

+40
-10
lines changed

R/create.R

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@ create_project <- function(path,
9191
#' required in order for `create_from_github()` to do ["fork and
9292
#' clone"](https://help.github.com/articles/fork-a-repo/). It is also required
9393
#' by [use_github()], which connects existing local projects to GitHub.
94+
#' [use_github()] has more detailed advice on working with the `protocol` and
95+
#' `credentials` arguments.
9496
#'
95-
#' @seealso [use_course()] for one-time download of all files in a Git repo,
96-
#' without any local or remote Git operations.
97+
#' @seealso [use_github()] for GitHub setup advice. [use_course()] for one-time
98+
#' download of all files in a Git repo, without any local or remote Git
99+
#' operations.
97100
#'
98101
#' @inheritParams create_package
99102
#' @param repo_spec GitHub repo specification in this form: `owner/repo`.
@@ -115,6 +118,17 @@ create_project <- function(path,
115118
#' @examples
116119
#' \dontrun{
117120
#' create_from_github("r-lib/usethis")
121+
#'
122+
#' create_from_github("r-lib/usethis", protocol = "https")
123+
#'
124+
#' ## various ways code can look when specifying ssh credential explicitly
125+
#' create_from_github("r-lib/usethis", credentials = git2r::cred_ssh_key())
126+
#'
127+
#' cred <- git2r::cred_ssh_key(
128+
#' publickey = "path/to/id_rsa.pub",
129+
#' privatekey = "path/to/id_rsa"
130+
#' )
131+
#' create_from_github("cran/TailRank", credentials = cred)
118132
#' }
119133
create_from_github <- function(repo_spec,
120134
destdir = NULL,

R/github.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#' `use_github()` takes a local project, creates an associated repo on GitHub,
44
#' adds it to your local repo as the `origin` remote, and makes an initial push
55
#' to synchronize. `use_github()` requires that your project already be a Git
6-
#' repository, which you can accomplish with [use_git()], if needed.
6+
#' repository, which you can accomplish with [use_git()], if needed. See the
7+
#' Authentication section below for other necessary setup.
78
#'
89
#' @section Authentication:
910
#' A new GitHub repo will be created via the GitHub API, therefore you must
@@ -13,8 +14,8 @@
1314
#' environment variable. Use [browse_github_pat()] to get help obtaining and
1415
#' storing your PAT. See [gh::gh_whoami()] for even more detail.
1516
#'
16-
#' The argument `protocol` reflects how you wish to authenticate with GitHub
17-
#' for this repo in the long run. This determines the form of the URL for the
17+
#' The argument `protocol` specifies the transport protocol you wish to use for
18+
#' this repo in the long run. This determines the form of the URL for the
1819
#' `origin` remote:
1920
#' * `protocol = "ssh"`: `git@@github.com:<OWNER>/<REPO>.git`
2021
#' * `protocol = "https"`: `https://github.com/<OWNER>/<REPO>.git`

man/create_from_github.Rd

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/use_github.Rd

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)