【发布时间】:2017-05-30 05:32:04
【问题描述】:
面临的问题:
我不能 git push 到我的仓库,错误消息:
remote: Permission to fishercoder1534/Leetcode.git denied to MY_OLD_GITHUB_ACCOUNT
fatal: unable to access 'https://github.com/fishercoder1534/Leetcode.git/':
The requested URL returned error: 403`
我做过的研究:
- 看着这个post,我所有这些都正确指向了我的新 github 帐户:
git config --global user.name "NewAccountFirstname NewAccountLastname" git config --global user.email "my_new_github_account_email@gmail.com" - 我已经删除了旧的 ssh 密钥,生成了新的 ssh 密钥,将它们放在 ~/.ssh/ 下,还将它们添加到我的新 Github 帐户中。
- 我创建了一个 ~/.ssh/config 文件,其中包含上述帖子所建议的以下内容:
Host github.com User git IdentityFile ~/.ssh/id_rsa # wherever your "new" key lives IdentitiesOnly yes - 我已经运行了
$ssh -vT git@github.com,它都显示了我的新 Github 帐户信息。Hi fishercoder1534! You've successfully authenticated, but GitHub does not provide shell access. - 我已经运行了
$ssh -i ~/.ssh/id_rsa -vT git@github.com,它还显示了我的新 Github 信息,Hi fishercoder1534! You've successfully authenticated, but GitHub does not provide shell access.
下一个尝试/帮助的选项是什么?
【问题讨论】:
标签: linux git shell github ssh