【发布时间】:2015-08-08 05:18:32
【问题描述】:
当我 git clone 来自 github 的仓库时 - 一切正常。下载了 repo,但是当我尝试将更改推送到 repo 时,git 说:
ERROR: Permission to my_user_name/repo_name.git denied to other_user_name.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
所以我尝试推送到我的仓库,但 github 认为我是其他用户。这是怎么发生的? (那个人属于我的团队——我们一起做几个项目)。以及如何解决这个问题?
当我执行ssh -T -ai ~/.ssh/id_rsa git@github.com 时 - 它说other_user_name 被授权,而不是我!但是当我这样做时ssh -T -ai ~/.ssh/id_rsa git@bitbucket.com - 它会告诉我我的名字。这怎么可能?
【问题讨论】:
-
检查
$ git config --list | grep user是否正确 -
它显示了我的用户名和电子邮件:)
-
检查您是否推送到正确的遥控器。您可以使用
git remote -v列出您的遥控器 -
是的,遥控器是正确的