How to change remote git repositories credentials?


Hi, recently I added a remote origin to a git repo I'm working on, but the credentials I used were wrong. Every time I try to add the remote it tries to connect and throws a 403 error. I don't know where to change or reset them. I already chose the option "do not store passwords" in settings -> passwords but still nothing. Please any help is appreciated. Thanks!

Comment actions Permalink

IDE uses command line git, which itself can cache credentials. What happened, I believe, that git saved wrong credentials and tries using it in the background, without asking IDE what creds to use.


Check the output of the followng command executed in the corresponding repository:

git config credential.helper

It will show you what helper is in use. Usually, it is default keychain. Then you could clear wrong credentials from the helper, or totally disable it to let IDE handle passwords.

Comment actions Permalink

Thanks Dmitriy, that command put me in the right direction. Executing showed nothing on my console, so I added the credential store like this:

git config --global credential.helper credential-store

Then after pushing via console and entering the right credentials it worked. In the end it wasn't the IDE's fault but the way git does things. Thank you!

Comment actions Permalink

Ran into the exact same thing, this solved it for me (

$ git credential-osxkeychain erase
host=[host, in my case]
protocol=[protocol, in my case, https]
[Press Return]



Please sign in to leave a comment.