使用git clone命令时出现Permission denied (public key) 。

解决方法:

  1. ssh-add ~/.ssh/id_rsa
  2. ssh-add -l查看是否添加成功
  3. 若报错(Could not open a connection to your authentication agent),执行

    1
    eval \`ssh-agent\`
  4. 重复上述命令