Git clone报错解决

134 阅读1分钟

Git clone报错: git@gitee.com: Permission denied (publickey).

fatal: Could not read from remote repository.

报错图片如下: QQ图片20221013193656.png

报错缘由
没有生成SSH公钥git

解决方法

1.在需要克隆的文件夹中,右键 打开Git Bash Here

image.png 2.设置用户信息

git config --global user.name "你的用户名" git config --global user.email "git邮箱或者gitLab邮箱"

查看配置信息

git config --global user.name

git config --global user.email

检查本地ssh key是否存在

打开windows下 C:\Users\ 看有没有.ssh文件夹,有就打开 id_rsa.pub 文件

复制里面的内容,粘贴到 git上 创建个人秘钥

image.png

重新打开Git Bash 输入 git clone"复制到的地址"

image.png