How to start using a personal access token to authenticate git on windows

I have created a personal access token to replace the use of password using git over hhtps. From the help docs I’ve read on the subject, I can’t find straight forward information about how to start using the PAT and replace my current form of authentcaition which is a password. When I perform git operations, I am not being prompted for a password so I guess the windows credential manager is managing the password authentication for me. So what do I need to do to actually make the switch? And what ever I do to make the switch, is this a universal change accross all git accesss, or will I have to do something on a per repo basis. For ssh, you would use ssh-add. But what do you do for a PAT using https?

This article (Creating a personal access token - GitHub Docs) doesn’t tell you this information and it probably should; well apart from clong the repo, but I dont need to clone it because I’m currently working on it!

If you are still using an existing cached password for you login you will need to remove it, the below will help, hopefully :slight_smile:

Launch ‘Credential Manager’ on your Windows device.
Switch to tab Windows Credentials (it default displayed tab Web Credentials on my device).
A list of locally cached credentials are then shown
Find an entry starting something like git:htttps// (this will be an exist cached entry for your username/password. You can safely delete this by selecting the entry and clicking on .Remove’.

You will then be prompted for credentials on you next git action requiring authentication
when prompted for username ener login
when prompted for password enter YOUR-PAT you created earlier.

Good luck

1 Like

Works on Linux-kde too :slight_smile:

1 Like