From a02416fcce2301ddd0101c7cd03fc25abcac42bf Mon Sep 17 00:00:00 2001 From: Rory Nolan Date: Sat, 27 Jan 2024 08:10:07 -0800 Subject: [PATCH 1/2] Update pkg-refs.Rmd to include info on PAT environment variables. --- tools/doc/pkg-refs.Rmd | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/tools/doc/pkg-refs.Rmd b/tools/doc/pkg-refs.Rmd index fb81738f..3a1d6290 100644 --- a/tools/doc/pkg-refs.Rmd +++ b/tools/doc/pkg-refs.Rmd @@ -255,16 +255,29 @@ https://github.com/r-lib/withr/releases/tag/v2.1.0 A GitHub remote string can also be used instead of an URL, for example: `git@github.com:r-lib/pak.git` +For private GitHub repositories, the `gitcreds` package attempts to +retrieve the relevant credentials using +`gitcreds::gitcreds_get(url = "https://github.com")`. See the docs of +`gitcreds::gitcreds_get` for full details. Briefly, you can run +`gitcreds::gitcreds_get(url = "https://github.com")` manually yourself +to see if it finds anything. If it does not, get a GitHub +_personal access token_ (PAT) and then call +`gitcreds::gitcreds_set(url = "https://github.com")` and follow the +instructions. Alternatively (less secure), set the +`r gitcreds::gitcreds_cache_envvar("https://github.com")` environment +variable to the PAT in your `~/.Renviron` file. + ### GitLab packages (`gitlab::`) Packages from a GitLab repository. Full syntax: ``` -[=][github::]/[/][] +[=][gitlab::]/[/][] ``` - `` is the name of the package. If this is missing, then - the name of the repository is used. + the name of the repository is used, unless a `subdir` is specified, + in which case that is used. - `` is a GitLab username or group name. - `` is the name of the repository. - `` optional subdirectory, if the package is within a @@ -274,6 +287,18 @@ Packages from a GitLab repository. Full syntax: If `` is missing, then the latest commit of the _default_ branch is used. +For private GitLab repositories, the `gitcreds` package attempts to +retrieve the relevant credentials using +`gitcreds::gitcreds_get(url = "https://gitlab.com")`. See the docs of +`gitcreds::gitcreds_get` for full details. Briefly, you can run +`gitcreds::gitcreds_get(url = "https://gitlab.com")` manually yourself +to see if it finds anything. If it does not, get a GitLab +_personal access token_ (PAT) and then call +`gitcreds::gitcreds_set(url = "https://gitlab.com")` and follow the +instructions. Alternatively (less secure), set the +`r gitcreds::gitcreds_cache_envvar("https://gitlab.com")` environment +variable to the PAT in your `~/.Renviron` file. + Examples: ``` gitlab::gaborcsardi/cli From ab10ea515bbe607a7d9283ad9a261e4402c1b26d Mon Sep 17 00:00:00 2001 From: Rory Nolan Date: Sat, 27 Jan 2024 08:22:34 -0800 Subject: [PATCH 2/2] Prettify. --- tools/doc/pkg-refs.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/doc/pkg-refs.Rmd b/tools/doc/pkg-refs.Rmd index 3a1d6290..6d01b9f9 100644 --- a/tools/doc/pkg-refs.Rmd +++ b/tools/doc/pkg-refs.Rmd @@ -258,7 +258,7 @@ A GitHub remote string can also be used instead of an URL, for example: For private GitHub repositories, the `gitcreds` package attempts to retrieve the relevant credentials using `gitcreds::gitcreds_get(url = "https://github.com")`. See the docs of -`gitcreds::gitcreds_get` for full details. Briefly, you can run +`gitcreds::gitcreds_get()` for full details. Briefly, you can run `gitcreds::gitcreds_get(url = "https://github.com")` manually yourself to see if it finds anything. If it does not, get a GitHub _personal access token_ (PAT) and then call @@ -290,7 +290,7 @@ branch is used. For private GitLab repositories, the `gitcreds` package attempts to retrieve the relevant credentials using `gitcreds::gitcreds_get(url = "https://gitlab.com")`. See the docs of -`gitcreds::gitcreds_get` for full details. Briefly, you can run +`gitcreds::gitcreds_get()` for full details. Briefly, you can run `gitcreds::gitcreds_get(url = "https://gitlab.com")` manually yourself to see if it finds anything. If it does not, get a GitLab _personal access token_ (PAT) and then call