4

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.

Lloyd7113
  • 187
  • 3
  • 12
  • I've never used Git integration with an IDE, so I'm just taking a wild guess here; is the account stored on the system? If you're not using SSH (which I would recommend; it also makes multi-account management easier), you can (on Windows) remove the account from the system (Control panel -> credential manager -> windows credentials. Remove GH from the list). If, however, the credentials are stored in Android Studio/IntelliJ, this won't work. – Zoe Jan 18 '19 at 12:38

1 Answers1

4

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250