Git拉取的时候报无权限
报错内容:
正克隆到 ‘http__’…
Warning: Permanently added 'code.******.com.cn,111.111.12.12’ (ECDSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
之前一直正常使用的出问题了,刚开始有点疑惑,想了想终于明白了,前几天试着玩秘钥,可能是被自己玩坏了.
解决方法
- ssh-keygen -t rsa -C “[此处为git上的name]”
- cd .ssh/
- ls
- 查看 id_rsa.pub里的内容,并copy出来
- 到git里将copy的内容添加到