Lloyd7113
Lloyd7113

Reputation: 307

Signed Into Wrong Git Account in Android Studio

I'm working for a team right now in Android Studio, and am currently signed into another team member's Github account. I needed to push to a repo from Intellij, and in the moment it was easier for the member who owned it to sign in and use his account, than to add mine to the repository. Now, I need to push to my own repo, and can't, because I'm still (somewhere) signed into my teammate's account. I have tried using the terminal to change user.name and user.email, to no avail. He was the first to ever sign in on this computer, and I'm still getting a 403 error so where do I go from here? Is there a way to sign him out?

EDIT: For future reference, the link provided by @VonC about removing the account solved the issue.

Upvotes: 4

Views: 8094

Answers (1)

VonC
VonC

Reputation: 1327094

See "Set passwords for Git remotes" for IntelliJ IDEA (which does apply for Android Studio)

If you are using HTTP to access a remote, Git requests credentials from a credential helper when you perform an operation that requires authentication. If no credential helper is found, it returns a prompt to the IDE.

Check the value of git config credential.helper: if your remote URL is an HTTPS one, the credential helper would have cached the credentials of the other member.

You need to delete that credential first (as shown here), before Android Studio is able to prompt you for your credentials at the next push.

Check also the IntelliJ IDEA password policy.

Upvotes: 4

Related Questions