How to I use a new GitHub PAT

I have been using GH for years and I am now getting "password authentication was removed" messages when I push. I used Chapter 10 from Happy Git With R and setup a new PAT using:

usethis::create_github_token()

and then

library(credentials)

set_github_pat()

It seemed to work but I am still getting same error. How do I tell RStudio/git to stop using my old password and use the newly setup token?

I just did this myself and the following seemed to work fine. After the create_github_token step, try:

gitcreds::gitcreds_set()

gitcreds should be installed with usethis, although you may need to update libraries. That should guide you through a process to change your authentication where you can paste in your PAT.

You can check to make sure everything is looking good with:

usethis::git_sitrep()
1 Like

I used the gitcreds_set() and told it to replace and now it works. It is weird. It did not prompt me for the new key (which I had entered hours ago) but the git_sitrep() returned the key. I wonder if
gitcreds_set() gave it the poke it needed or if it was just a time thing.

Regardless, thank you kindly!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.