由于电脑重装再次会想起首次配置git远程克隆仓库的bug,出现以下bug

The authenticity of host 'gitee.com (手动打码)' can't be established.
ECDSA key fingerprint is 手动打码.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'gitee.com,手动打码' (ECDSA) to the list of known hosts.
Bad packet length 393759手动打码.
ssh_dispatch_run_fatal: Connection to 手动打码 port 22: Connection corrupted
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

原因是没有将MAC本地公钥配置到git上,解决方法:
1.生成SSH Key(已经有公钥的直接跳到第二步)
打开终端输入ssh-keygen -t rsa -C "此引号内填写邮箱地址"

2.打开访达前往.ssh目录,找到生成Key值的目录,这个目录下会生成三个文件:id_rsa(私钥),id_rsa.pub(公钥),known_hosts。
在这里插入图片描述
在这里插入图片描述

3.用文本编辑打开id_rsa.pub文件,复制文件全部内容
在这里插入图片描述

4.登陆码云https://gitee.com/,按一下步骤操作,把刚复制的公钥黏贴到相应位置,操作完成后就可正常克隆了,亲测有效~!

在这里插入图片描述

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐