admin管理员组文章数量:1530062
1、重新安装Git工具
可以参考个该链接重新下载安装:
Windows系统Git安装教程(详解Git安装过程)
2、重新配置
用 git config
配置 Git:
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example
3、尝试拉取
报错:
$ git pull origin master:master
The authenticity of host 'gitee (212.64.62.183)' can't be established.
ED25519 key fingerprint is SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96PAUCoV88.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitee' (ED25519) to the list of known hosts.
git@gitee: Permission denied (publickey).
fatal: Could not read from remote repository.
这样就需要重新生成公钥然后添加到你的git远程服务账号下:
1)生成新的公钥
ssh-keygen -t rsa -C “johndoe@example”(执行后一直回车就可以了)
2)查看你生成的公钥
三种方式查看,打开你的git bash 窗口:
1)
a.进入.ssh目录:cd ~/.ssh
b.找到id_rsa.pub文件:ls
c.查看公钥:cat id_rsa.pub 或者vim id_rsa.pub
2)cat ~/.ssh/id_rsa.pub
3)也可以直接打开C盘你用户目录(一般都是Administrator)下的.ssh文件夹,打开它里面的id_rsa.pub 文件。
3) 将新生成的公钥添加到你的远程Git服务账号下(Github或者Gitee吧)
4)添加完成之后,再在本地Git Bash上验证一下
终端输入验证:
ssh -T git@gitee
如图结果表示添加操作成功。
最后在试试拉取一下代码是不是就成功了。
版权声明:本文标题:重装系统后,git无法拉取远程仓库更新 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1726758533a1083268.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论