I got stuck today in 2025 and ChatGPT was of no use.
I tried above solutions from above people but it don't worked.
A simple solution worked for me with one command.
git config --global --unset credential.helper