From 6b13e1240b72ce16100a11be8b3e5ce20bedfbaf Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Tue, 20 Feb 2024 12:31:57 -0800 Subject: [PATCH] document use of PATs with Git (closes #1281) --- vignettes/package-install.Rmd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vignettes/package-install.Rmd b/vignettes/package-install.Rmd index 5b8fd547c..7f8adbe8c 100644 --- a/vignettes/package-install.Rmd +++ b/vignettes/package-install.Rmd @@ -318,6 +318,7 @@ For example, the igraph package on GitHub at renv::install("igraph=igraph/rigraph") ``` + #### Azure DevOps Authentication with Azure DevOps may require credentials to be set in a slightly different way. In particular, you can use: @@ -330,6 +331,23 @@ GITHUB_PASS = replacing `` and `` as appropriate -- for example, your password may just be a PAT. See https://github.com/rstudio/renv/issues/1751 for more details. +#### Git and Personal Access Tokens + +Rather than username + password, some remote Git repositories might require Personal Access Tokens (PATs) for authentication. Typically, such servers expect authentication credentials where: + +- Your PAT is supplied as the username, +- Either an empty response, or the string `x-oauth-basic`, is provided as the password. + +To help facilitate this, you can set: + +``` +GIT_USER = +GIT_PASS = x-oauth-basic +``` + +in an appropriate startup R file. + + ### Custom headers If you want to set arbitrary headers when downloading files using renv, you can do so using the `renv.download.headers` R option.