How to update a password in my terminal?

I changed a password on Github via the settings. After that, I changed the URL link to the remote repo exectuted:  git remote set-url origin https://Andrey01@github.com/Andrey2470T/luxury_decor  and  git push. The last command asked for a password and I entered the new one, but it reported an error to me: remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/Andrey2470T/luxury_decor’. 

That is, is it refers yet to the old password? How to fix it?

 

Hi @andrey2470t 

That depends on where the password has been stored. It could be in .git/config in the repository, or in a credential helper. You can run git config credential.helper to see which one you use.

Theres nothing about my current password in config file. And also git config credential.helper` doesnt derive anything to the terminal.

https://help.github.com/en/github/using-git/updating-credentials-from-the-osx-keychain

Hi @andrey2470t, thank you for being here! I think clearing your credentials and re adding them again might help.

To delete:
https://help.github.com/articles/updating-credentials-from-the-osx-keychain/#deleting-your-credentials-via-the-command-line

To add again:
https://help.github.com/articles/caching-your-github-password-in-git/