Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git suddenly won't authenticate to GitHub automatically

I wanted to push to a remote repo on GitHub. I typed git pull origin main exactly as I have a hundred times but I get the error:

fatal: Unable to persist credentials with the 'wincredman' credential store.

I've tried everything I could find. I unset my credential manager, deleted old credentials in Windows Credential Manager, tried creating a PAT. I finally managed to successfully pull/push using the PAT, but now I have to manually input my username and PAT every single time.

I have no idea what happened, but I would love to be able to push/pull from remote without needing to login.

like image 799
BardYoren Avatar asked Dec 09 '25 16:12

BardYoren


2 Answers

The same issue happened to me when I push file from visual studio to github. When you will get Unable to persist credentials with the 'wincredman' credential store this type of error. Just type this command on command prompt

git config --global credential.credentialStore dpapi and after that type git push command . It works for me.

like image 171
Priyanka Jadhav Avatar answered Dec 12 '25 09:12

Priyanka Jadhav


The same issue happened to me when I was trying to pull any incoming on the master branch using the Git Repository window in Visual Studio Professional 2022 (64-bit) Version 17.4.2.

Here is what worked for me:

  1. Delete the existing git credential in Windows Credential Manager
    1. Type "Credential Manager" in Windows search bar
    2. Select "Windows Credentials"
    3. You should see a list of Generic Credentials
    4. If you see one that starts with "git:https://dev.azure.com/{your_organization}", expand it by clicking the down arrow, and click "Remove"
  2. Close any Visual Studio you have opened
  3. Right click Visual Studio and do "Run as administrator"
  4. Now when you try to do a Pull again, it should prompt you the login screen
  5. After successfully logging in, a git credential should be recorded in Windows Credential Manager
like image 30
David Liang Avatar answered Dec 12 '25 09:12

David Liang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!