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

后端 未结 30 1796
野性不改
野性不改 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

    Got same error report.

    Fixed with using HTTP instead. Since I don't want set "SSH keys" for a test PC.

    Change URL to HTTP when clone:

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

    My problem is a little bit different: I have URL set when adding a existing local repo to remote, by using:

    git remote add origin ssh://github.com/USERNAME/REPOSITORY.git
    

    To fix it, reset URL to HTTP:

    git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
    

    BTW, you may check your URL using command:

    git remote -v
    origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
    origin  https://github.com/USERNAME/REPOSITORY.git (push)
    

    Hope this will help some one like me. :D

提交回复
热议问题