How to solve Permission denied (publickey) error when using Git?

后端 未结 30 1792
野性不改
野性不改 2020-11-22 08:07

I\'m on Mac Snow Leopard and I just installed git.

I just tried

git clone git@thechaw.com:cakebook.git

but that gives

30条回答
  •  粉色の甜心
    2020-11-22 08:15

    I met the same issue because of I was thought the difference between SSH and HTTPS is

    https://github.com/USERNAME/REPOSITORY.git

    ssh://github.com/USERNAME/REPOSITORY.git

    So I changed from HTTPS to SSH just by changing https:// to ssh:// nothing on the end of the url was changed.

    But the truth is:

    https://github.com/USERNAME/REPOSITORY.git
    
    git@github.com:USERNAME/REPOSITORY.git
    

    Which means I changed ssh://github.com/USERNAME/REPOSITORY.git to git@github.com:USERNAME/REPOSITORY.git it works.

    Stupid error but hope helps someone!

提交回复
热议问题