This has nothing to do with your user.name
/user.email
settings: those are for authorship in a commit. They are not used for authentication when you push to a repo.
If Git does not ask you for your GitHub (new) username/password, that means Git for Windows is using a Git credential helper called "manager" (do a git config credential.helper
to confirm it)
Meaning: it is caching your old credentials and is reusing them automatically.
In that case, go to the Windows start menu (), type "credential" and select the Windows tool "Windows Credential Manager".
In it, you will find an entry git.https://github.com
, which you can edit, and where you can enter your new GitHub username/password.
Then try and push again.
With more recent Git version (2.32+, Q2 2021), assuming <C:pathogit>usrin
and <C:pathogit>mingw64libexecgit-core
are in your %PATH%
, you can do the same removal in command-line:
printf "protocol=https
host=github.com
username=xxx"| git-credential-manager-core erase
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…