在Android Studio中登录了错误的Git帐户 [英] Signed Into Wrong Git Account in Android Studio

查看:482
本文介绍了在Android Studio中登录了错误的Git帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在Android Studio中为团队工作,目前已登录另一个团队成员的Github帐户.我需要推送到Intellij的仓库,此刻,拥有它的成员登录并使用他的帐户要比向存储库添加我的帐户容易.现在,我需要推送到自己的存储库,而不能,因为我仍然(某处)登录了队友的帐户.我尝试使用终端将user.name和user.email更改为无济于事.他是第一个在这台计算机上登录的人,但是我仍然遇到403错误,因此我应该从这里去哪里呢?有没有办法将他注销?

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?

供以后参考,@ VonC提供的有关删除帐户的链接解决了该问题.

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

推荐答案

请参见"

如果您使用HTTP访问远程服务器,则Git在执行需要身份验证的操作时会从凭据帮助程序中请求凭据.如果未找到凭据帮助程序,则会将提示返回到IDE.

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.

检查git config credential.helper的值:如果您的远程URL是HTTPS,则凭据帮助程序将缓存另一个成员的凭据.

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.

您需要先先删除该凭据(如下所示),然后Android Studio才能提示您输入在下一次推送时获得凭据.

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.

还要检查 IntelliJ IDEA密码政策.

这篇关于在Android Studio中登录了错误的Git帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆