【发布时间】:2019-06-12 22:57:06
【问题描述】:
我最近从我在 GitHub 上的另一个用户帐户克隆了一个 git 存储库,如下所示:
git clone https://github.com/some_user/fav-front.git
我得到了:
remote: Permission to user_current/fav-front.git denied to user_prev.
fatal: unable to access 'https://github.com/user_current/fav-front.git/': The requested URL returned error: 403
但是我仍然可以使用我的当前用户进行 git push。
参考
https://help.github.com/en/articles/cloning-a-repository
https://help.github.com/en/articles/create-a-repo
更新
这似乎是一个身份验证问题。我注意到当我在我的仓库中执行 git config --list 时,我的用户信息都没有被填充。
我尝试手动设置我的用户名和电子邮件,但即使这样也没有用:
~/_top/fav-front> git config user.email 'foo@foo.com'
~/_top/fav-front> git config user.name 'foo'
【问题讨论】:
-
你是如何验证
git clone操作的? -
您通常如何在其他仓库中验证
git push? -
检查两个仓库中
git remote -v的输出。这将显示您使用的是 ssh 还是 https。 -
由于克隆是只读操作,因此不需要身份验证。它不应影响对其他存储库或帐户的任何身份验证。
-
对不起。我更新了我的问题。 Git 似乎认为我是一个不同的用户。不知道如何排除故障,因为
git config --list没有返回任何内容。