Git clone项目时候报错

clone 项目时候报错
Cloning into 'xxx new'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for git.xxxxx.com has changed,
and the key for the corresponding IP address 172.20.107.213
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:b9CCBpNyA1vDh4avmXzqgxZczo8u2bHE6/HjeZb18BQ.
Please contact your system administrator.
Add correct host key in /c/Users/GetOn/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/GetOn/.ssh/known_hosts:4
RSA host key for git.xxxxx.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

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

多次更新不下来项目

  1. 删除.ssh文件夹(直接搜索该文件夹)下的known_hosts(手动删除即可,不需要git)

  2. 在下载好的Git中的bin目录下打开bash.exe输入命令ssh-keygen -t rsa -C “username” (注:username为你git上的用户名),如果执行成功。返回:

    Generating public/private rsa key pair.
    Enter file in which to save the key (/Users/username/.ssh/id_rsa):

//这里的username是电脑上的用户名,这个地址也是文件的存储地址,然后我们按回车,如果你以前有存储地址会返回/Users/your username/.ssh/id_rsa already exists.Overwrite (y/n)?直接输入y回车。如果以前没有储存地址就会出现 Enter passphrase(empty for no passphrase);也直接回车,两种情况回车后都会出现 Enter same passphrase again 然后接着回车会显示一长串内容其中还有一些…o… o oo .oS. 之类的代码,这说明SSH key就已经生成了。文件目录就是:username/.ssh/id_rsa.pub.

  1. 然后找到系统自动在.ssh文件夹下生成两个文件,id_rsa和id_rsa.pub,用记事本打开id_rsa.pub将全部的内容复制。

  2. 打开https://github.com/,登陆你的账户,进入设置(Settings)找到

  3. 然后将你复制的内容粘贴到key中

ok还有最后一步
  1. 仍然在bash.exe中输入

    ssh -T git@github.com
    

然后会跳出一堆内容你只需输入yes回车就完事了,然后他会提示你成功了。
然后你就可以正常使用git clone命令了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值