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

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

    Visual guide (Windows)

    1 of 2. Git batch side

    1.1. Open git batch (Download her)

    1.2. Paste the text below (Change to your GitHub account email)

    $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    

    1.3. Press Enter (Accepts the default file location)

    1.4. Click Enter Twice (Or set SSH key passphrases - Gitbub passphrases docs)

    > Enter passphrase (empty for no passphrase): [Type a passphrase]
    > Enter same passphrase again: [Type passphrase again]
    

    1.5. The key generate:

    Your identification has been saved in /c/Users/user/.ssh/id_rsa...

    1.6. Copy the SSH key to your clipboard.

    $ clip < ~/.ssh/id_rsa.pub

    2 of 2. Github website user side

    Under user setting Create key:

    Paste the code from step 1.6

    Done :)


    If someone doesn't want to use SSH use HTTPS :

    Github docs: https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh

提交回复
热议问题