DEV Community

Cover image for Updating your GitHub Personal Access Token for Windows
jesusbaquiax
jesusbaquiax

Posted on

Updating your GitHub Personal Access Token for Windows

Happy December everyone! My Personal Access Token (PAT) for GitHub recently expired and I completely forgot how to update it. After spending about thirty minutes reading different online articles that had a variety of methods to update your PAT. I want to provide a condensed set of instructions that will hopefully be helpful to anyone whose PAT has recently expired. These instructions are for Windows and allows you to cache your PAT so that you don't have to input it every time you git clone/ git push a new repo.

Step 1) Create Personal Access Token

GitHub provides a clear and succinct set of instructions to create a PAT on their website. After creating your new PAT, do not close the window that contains the new PAT until you have finished these steps. Link to instructions is here

Step 2) Add Credentials to Windows Credential Manager

  • Go to Credential Manager
  • Click on "Windows Credential"
  • Click on "Add a generic credential"
  • For "Internet or network address" Type in: 'git:https://github.com'
  • For "User name" type in 'GitHub User Name'
  • For "Password" paste in 'Personal Access Token'
  • Click OK
  • Rejoice! You Are Done!

If the previous GitHub Credential is still listed under "Generic Credentials", you can update the PAT by clicking on the GitHub credential and then clicking on the "Edit" button and pasting in the new PAT in the password field.

To ensure that everything was done successfully, try to git push your local repo to GitHub. If you get no error messages, then the update was a success. Let me know if this was helpful or not. Thank you!

Top comments (0)