【问题标题】:Github The requested URL returned error: 403 remote: Permission to userGithub The requested URL returned error: 403 remote: Permission to user
【发布时间】:2017-11-11 23:36:03
【问题描述】:

我有两个具有两个不同电子邮件 ID 的 GitHub 帐户,

目前,我的.gitconfig如下;

[filter "lfs"]
    process = git-lfs filter-process
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    required = true
[user]
    name = joshinachiket
    email = nachiket.r.joshi@gmail.com
[core]
    autocrlf = true
    excludesfile = C:\\Users\\NACHIKET\\Documents\\gitignore_global.txt

不过,当我想提交到存储库时,它会说,

remote: Permission to joshinachiket/CMPE295-enterprise-grade-botman.git denied to TheBloodMage.
fatal: unable to access 'https://github.com/joshinachiket/CMPE295-enterprise-grade-botman.git/': The requested URL returned error: 403

TheBloodMage 是我在其他 github 电子邮件 ID 中的用户 ID。

我在问题中显示的 .gitconfig 内容是我创建存储库的帐户,ID TheBloodMage 是我不使用的其他 github 帐户(我的旧帐户)想要访问。

所以基本上,

  1. 我用 github id 创建了一个存储库 - joshinachiket

  2. 我在计算机上克隆了存储库,其中 .gitconfig 显示相同的 ID 和电子邮件,如上所示

  3. 不过,错误提示 TheBloodMage 无权访问存储库。

我被这个问题困扰了很长时间...... 谁能告诉我我做错了什么?

【问题讨论】:

标签: git github ssh github-for-windows


【解决方案1】:

仔细检查您是否有一个 credential helper,该 credential helper 会缓存您的(旧帐户)凭据(用户名/密码),用于对您进行身份验证。

git config credential.helper 

在 Windows 上,这将是 Windows Credential Managers
打开 Windows Credential Store,查看第一个用户是否在那里注册:删除该条目,您将能够与第二个用户进行身份验证。

(这里是 BitBucket 的一个例子)

【讨论】:

    【解决方案2】:

    您有 GitHub 存储库:http://github.com/user_name/repository_name

    您有 2 个帐户,您希望另一个帐户访问现有存储库。

    转到https://github.com/user_name/repository_name/settings/collaboration

    这样做

    【讨论】:

    • 我在问题中显示的 .gitconfig 内容属于我创建存储库的 github 帐户。并且 ID TheBloodMage 是我不想授予访问权限的其他一些 github 帐户。所以基本上, 1. 我创建了一个带有 github id - joshinachiket 的存储库 2. 我在计算机上克隆了存储库,其中 .gitconfig 显示了相同的 ID 和电子邮件,如上所示 3. 尽管如此,错误表明 TheBloodMage 无法访问存储库。这就是我的问题。如有任何困惑,请见谅。
    猜你喜欢
    • 2021-08-16
    • 2021-02-10
    • 2020-09-30
    • 2021-09-07
    • 2020-10-26
    • 2019-02-08
    • 1970-01-01
    • 2020-12-11
    • 1970-01-01
    相关资源
    最近更新 更多