Pawan Nirpal
Pawan Nirpal

Reputation: 622

Vs-code keeps prompting me to authenticate on every git push

Thanks for looking into this, I use a windows10 machine, This is an issue I've been facing now for over past few months, as it happens visual studio code keeps prompting me repeatedly for username and password for every git push, I've tried caching the credentials by using git config --global credential.helper wincred As per this page and also This stackoverflow post did not help I tried git config --global credential.helper cache and this {"git.autofetch": false} none of these worked, can you please help me ?

Vscode info

Version: 1.52.0 (system setup)
Commit: 940b5f4bb5fa47866a54529ed759d95d09ee80be
Date: 2020-12-10T22:45:11.850Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.18363

Upvotes: 4

Views: 10103

Answers (2)

Elnoor
Elnoor

Reputation: 3752

Looks like your credentials are not being stored anywhere. Run this command on powershell

git config --global credential.helper wincred

Which would allow git to store credentials on Windows Credential Manager. Then do a git fetch or pull and once again enter your credentials as prompted. This time your credentials should be stored and you won't be promoted.

You can verify that by going to Credentials Manager (by searching on Start menu), then select Windows Credentials and under Generic Credentials you will find your git host either created or updated "today".

If it won't work, delete the git folder and clone again.

Upvotes: 4

2189490
2189490

Reputation: 137

When this happened to me, I added my credentials to Windows Credential Manager with the git repo as the host address. You should be able to search as “Windows Credential Manager” from the start menu

Upvotes: 0

Related Questions