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

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

    I was getting the same error. My problem was mixing in sudo.

    I couldn't create the directory I was cloning into automatically without prefixing the git clone command with sudo. When I did that, however, my ssh keys where not being properly referenced.

    To fix it, I set permissions via chmod on the parent directory I wanted to contain my clone so I could write to it. Then I ran git clone WITHOUT a sudo prefix. It then worked! I changed the permissions back after that. Done.

提交回复
热议问题