windows端

查看本机ssh 公钥

如果没有公钥的话,需要生成

$ ssh-****** -t rsa -C "邮箱地址" 

Mac端

cd ~/.ssh/

没有的话,需要生成

ssh-****** -t rsa -C "邮箱地址"

cat id_rsa.pub

 

github 添加 deploy key

如果是新建的仓库的话,需要生成新的key,

然后把 id_rsa.pub 生成的key粘贴进去,就可以用了

 

如果工作和github都需要的话,当然先保证工作,github提交代码时会出现

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

 

这个错误,具体解决办法就是新建一个 github_id_rsa, 然后执行这个命令

$ ssh-add ~/.ssh/id_rsa

相关文章:

  • 2022-01-24
  • 2022-12-23
  • 2021-10-09
  • 2021-11-26
  • 2021-11-17
  • 2021-08-02
猜你喜欢
  • 2021-08-19
  • 2022-12-23
  • 2022-02-20
  • 2021-06-09
  • 2021-06-05
  • 2022-12-23
相关资源
相似解决方案