0

Since my last token for github authentication expired, git on windows prompt me that the username and password are invalid (Which is correct)

Only problem is, whatever I do, I cannot reset, change or remove them. I tried changing them in Credential Manager (Control Pannel > Credential Manager) I tried removing all entries corresponding to git or github, tried removing the credential helper (git config --unset credential.helper) on all level (--global, --local, etc.) But still nothing work.

The only way I can possibly push or pull changes at the moment is by using the git commands trough WSL2, which does prompt me for user and password(token that I have to either save somewhere or create a new one each time from GH)

I am out of idea and I cannot seem to find any other lead for a solution.

torek
  • 448,244
  • 59
  • 642
  • 775
Alex Boutin
  • 157
  • 1
  • 8
  • Have you tried looking if you have a file at C:\Users\\.git-credentials ? – git_gud Dec 10 '21 at 08:25
  • 1
    I don't have any files named `.git-credentials` but I did find in `.gitconfig` a parameter `[url "https://:@github.com"] insteadOf = https://github.com`. Once I removed that line, everything worked, thank you! – Alex Boutin Dec 10 '21 at 14:07

1 Answers1

0

Thanks to @SOROMEED comment, I was able to find the a new solution.

git config file, located in C:\Users\<username>\.gitconfig had the following block:

[url "https://<gh_username>:<old_gh_token>@github.com"]
    insteadOf = https://github.com

Removing that line, forced git to prompt for my credentials againt

Note: the gh_username was also incorrect since I changed it a couple month ago but was not changed in this file.

Alex Boutin
  • 157
  • 1
  • 8