Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get command line to re-prompt for username/password for github when cloning repository

Tags:

git

github

I am new to using github, and the professor of a class that I am in is storing the source code and assignment information in a repository that I need to clone with the following command git clone https://github etc. etc.

I incorrectly entered my username and password for Github the first time I was prompted, and now I'm stuck with failed authentications like remote: Invalid username or password fatal: Authentication failed because it won't reprompt me. Any insight into this issue? Some things online made it seem that it could be fixed by fiddling with a thing called credential.helper, but didn't make it clear how that would help.

like image 303
kepleroni Avatar asked Sep 03 '25 14:09

kepleroni


1 Answers

If you are on Windows, see "How do I sign out in the Git Bash console on Windows?"

printf "protocol=https\nhost=github.com" | git credential-manager reject 
# or
printf "protocol=https\nhost=github.com" | git credential-manager erase 

If you are on Mac, see "Updating credentials from the OSX Keychain"

See also this answer, but replacing "erase" with "delete" or "erase".

like image 141
VonC Avatar answered Sep 05 '25 13:09

VonC