【问题标题】:Re-authenticating access in git在 git 中重新验证访问权限
【发布时间】:2015-08-14 04:10:47
【问题描述】:

当我设置 git 时,我使用了一个用户名/电子邮件组合。

然后我在 GitHub 上更改了我的用户名和电子邮件组合。

现在,当我尝试推送到我的存储库时,我收到以下错误消息:

Permission denied (publickey)
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我知道存储库存在。所以我有一种感觉 git 正在尝试使用我的旧用户名和电子邮件与 gitHub 进行通信,而 obvi 现在无法识别为我。

如何清除存储的 github 帐户信息并在 git 中重新进行身份验证?

【问题讨论】:

    标签: git authentication github login account


    【解决方案1】:

    重要的部分是用户名:如果您更改了 GitHub 帐户,那么您需要确保您的 $HOME/.ssh/id_rsa.pub(或 %USERPROFILE%\.ssh\id_rsa.pub)已在该新帐户中注册。

    电子邮件部分不重要(gravatar displayed with your old commits 除外)

    【讨论】:

    • 抱歉,我有一段时间没有重新登录,但这正是我为修复它所做的。谢谢!
    猜你喜欢
    • 2020-03-04
    • 2013-03-21
    • 2016-09-19
    • 1970-01-01
    • 2019-10-11
    • 1970-01-01
    • 2021-07-31
    • 2013-07-22
    • 1970-01-01
    相关资源
    最近更新 更多