If you install packages from private repos often, passing your authorization token to install_github()
becomes tedious. You can avoid that pain very easily. Here is how.
Most of what you need to know is in ?devtools::install_github()
(or ?remotes::install_github()
):
# To install from a private repo, use auth_token with a token
# from https://github.com/settings/tokens. You only need the
# repo scope. Best practice is to save your PAT in env var called
# GITHUB_PAT.
install_github("hadley/private", auth_token = "abc")
However, that information is so compact that it is difficult to understand – let’s brake it down in two main steps: