Closed kelly-sovacool closed 2 years ago
So it might be easiest to set up the PAT in RStudio. The usethis
package has a lot of helper functions for this. See https://usethis.r-lib.org/articles/articles/git-credentials.html. It does not appear that usethis
is in the tidyverse
package so we would have to add install instructions for that. In theory it should interact with the OS credential manager so you can set it up in RStudio and still use at any command line. RStudio recommends using HTTPS over SSH. The usethis::git_sitrep()
command is useful to get an overview of how things are set up on your system.
Since the R session comes first, I think it makes sense to use RStudio to set things up. Is there a strong reason to prefer SSH over HTTPS? Is it possible to get access to "fresh" system images to test these methods on?
I tend to think we should show how to do it without RStudio for a few reasons:
usethis
...)I'm not sure about SSH vs HTTPS.
I'd prefer the easiest possible way for the learners. The thought of them having to mess with ssh keys is a bit worrisome
So far I've been instructing people to do the following to use a PAT:
store
by running git config --global credential.helper store
. Settings
> Developer settings
> Personal access tokens
> Generate new token
).No SSH keys involved!
Pushing to and pulling from GitHub now requires either an SSH key or a PAT in the command line. Put this content somewhere around the config/setup section. See SWC version here for inspiration: https://swcarpentry.github.io/git-novice/07-github/index.html#ssh-background-and-setup