[GIT] git pull "Invalid username or password"

Thought this might be worth sharing.

I had to change my AD credentials and after I'd changed the credentials, I could no longer do a 'git pull':

C:\Projects\MYPROJ> git pull
remote: Invalid username or password.
fatal: Authentication failed for '***github***'

And I wasn't getting prompted to re-enter my username and password. This is on a corporate Windows 10 Virtual Desktop.

After a bit of googling, I found this command -

C:\Projects\MYPROJ> git config --system --list

- which showed some config information including:

credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true

And then this command -

C:\Projects\MYPROJ> git config credential.helper ""

- which didn't change any of the 'git config --system --list' outputs, but it did make 'git pull' ask for my username and password again:

C:\Projects\MYPROJ> git pull
Username from 'https://***github***': MYNAME
Password for 'https://MYNAME@***github***':

But, slight problem. Now it kept asking for my username and password. So how do I make it retain my username and password so I don't keep getting prompted?

I ran -

C:\Projects\MYPROJ> git config credential.helper

- which showed nothing. Then I ran -

C:\Projects\MYPROJ> git config --unset credential.helper

- and I got prompted for username and password, and problem fixed 😊.


Note: I had previously tried -

C:\Projects\MYPROJ> git config --system --unset credential.helper

- and I got an error message:

error: could not lock config file ...gitconfig Permission denied


APPENDIX: Other git stuff:

git --help

Comments