Reputation: 171
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.
Upvotes: 15
Views: 26053
Reputation: 446
For visual studio scenario, following steps worked for me.
Open Visual Studio as administrator
Go to Git menu option
Click on Open Command Prompt option
A command prompt should open with C:/<username> or C:/<username>/<repo name>
Type and execute command
git config --global credential.credentialStore dpapi
After this try to do any pull or push operation of a mapped repo will prompt for fresh login into visual studio and once successfully logged in, repo can be pulled.
Prior to doing above, I had tried following and it did not work.
Upvotes: 0
Reputation: 1
git config --global credential.credentialStore dpapi and after that type git push command . It works for me. along with Delete the existing git credential in Windows Credential Manager.
Upvotes: 0
Reputation: 1
Removed credential from windows credential manager, but still problem was not resolved. There was an pending update in Visual Studio Installer for VS2017. After updating VS 2017, I was able to connect with credential manager.
Upvotes: 0
Reputation: 21476
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:
Upvotes: 4
Reputation: 71
I had this problem.
I followed the above advice David Liang and BardYolen gave on this post along with some additional stack overflows post and none of it worked.
I eventually had to launch visual studios installer. Modify my versions individual to include GitFor windows by going to individual components and checking the box next to "git for windows". Then, I updated my visual studios.
After that everything seemed to work.
I am unsure if I had git for windows in visual studios before that and it just got deleted somehow or if I never had it and something got updated to removed my access to used git without it.
Upvotes: 0
Reputation: 571
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.
Upvotes: 46
Reputation: 171
Honestly not really sure what I did to fix things. I deleted all of the credentials set in git/Windows Credential Manager/etc... Tried to pull from remote in VS Code and it made me log in to GitHub. Now everything is back to working as expected. It seems like I can only push/pull from VS Code the way that I want. I guess it works.
Upvotes: 2