File: double-auth.R

package info (click to toggle)
r-cran-usethis 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,228 kB
  • sloc: sh: 26; makefile: 17; cpp: 6; ansic: 3
file content (30 lines) | stat: -rw-r--r-- 1,402 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#' @section Git/GitHub Authentication:

#' Many usethis functions, including those documented here, potentially interact
#' with GitHub in two different ways:

#' * Via the GitHub REST API. Examples: create a repo, a fork, or a pull
#' request.

#' * As a conventional Git remote. Examples: clone, fetch, or push.
#'

#' Therefore two types of auth can happen and your credentials must be
#' discoverable. Which credentials do we mean?
#'

#' * A GitHub personal access token (PAT) must be discoverable by the gh
#'   package, which is used for GitHub operations via the REST API. See
#'   [gh_token_help()] for more about getting and configuring a PAT.

#' * If you use the HTTPS protocol for Git remotes, your PAT is also used for
#'   Git operations, such as `git push`. Usethis uses the gert package for this,
#'   so the PAT must be discoverable by gert. Generally gert and gh will
#'   discover and use the same PAT. This ability to "kill two birds with one
#'   stone" is why HTTPS + PAT is our recommended auth strategy for those new
#'   to Git and GitHub and PRs.
#' * If you use SSH remotes, your SSH keys must also be discoverable, in
#'   addition to your PAT. The public key must be added to your GitHub account.
#'
#' Git/GitHub credential management is covered in a dedicated article:
#' [Managing Git(Hub) Credentials](https://usethis.r-lib.org/articles/articles/git-credentials.html)