Git回购访问问题

时间:2016-09-22 06:33:42

标签: git ssh https

我已通过以下命令将ssh密钥添加到我的git repo中,现在得到以下错误:

CMD git config --global url.ssh://git@github.com/.insteadOf https://github.com/

 Error : User1’s-MacBook-Pro:untitled folder ndpiparava$ git clone  https://github.com/XXX-Asft/XXXX
Cloning into 'XXXXX'...
Permission denied (publickey).
fatal: Could not read from remote repository.

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

我意识到通过设置ssh而不是Https我犯了错误 有什么方法可以从我的远程git的ssh列表中删除我的ip并开始使用https?

1 个答案:

答案 0 :(得分:1)

  

git config --global url.ssh://git@github.com/.insteadOf https://github.com/

这意味着任何以https://github.com/开头的网址都会被ssh://git@github.com/重写。

没有“我的远程git的ssh列表中的ip”要删除。

您可以简单地delete that global config setting

git config --global --unset url.ssh://git@github.com/.insteadOf

你可以remove your public key you set on your GitHub account

相关问题