Home > Mobile >  How to update Github's PAT after regeneration?
How to update Github's PAT after regeneration?

Time:11-16

I had a perfectly working local-remote connection, but after regenerating Github's personal access token my project's git related commands stopped working, as expected.

When typing git pull for example, I was simply getting an authentication error, without opening a prompt for updating the PAT. Also I was unable to update PAT nor on macOS, nor on Windows via their credential managers.

CodePudding user response:

The Git FAQ explains how to reset the credential manager's credentials (substitute user for your username):

$ echo url=https://[email protected] | git credential reject

This will erase the credentials from an existing credential helper, so next time you pull or push, Git will prompt you for credentials again.

CodePudding user response:

Use this command to set a new remote with the updated Personal access token - PAT:

git remote set-url origin https://<githubUsername>:<newlyGeneratedPAT>@github.com/<organisation>/<repositoryName>
  • Related