ssh exchange identification

执行 git pull 的时候,提示(When I do the “git pull”)

ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

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

经过各种研究,发现了一个比较坑的问题(至少目前我遇到的就是),问题就是服务端有问题,具体是什么,不清楚,因为我不负责这块内容。只说一下,临时解决吧,因为需要,所以不能够等待服务端解决之后再去提交。 (I found this is because the)

这种问题是因为使用SSH提交导致的,但是发现使用HTTPS这种提交没有问题。git clone代码的时候,大家肯定会看到,给了两个选项,一个是SSH的地址, 一个是HTTPS的地址。

//输入命令

$ git remote -v
//输出 SSH的origin配置
origin	git@git.******.com:ict/project.git (fetch)
origin	git@git.******.com:ict/project.git (push)

//添加一个HTTPs origin 
//这里使用的是 HTTPS地址
git remote add origin2 https://git.******.com/ict/project.git

//输入命令

$ git remote -v
//输出 origin配置
origin	git@git.******.com:ict/project.git (fetch)
origin	git@git.******.com:ict/project.git (push)
origin2	https://git.******.com/ict/project.git (fetch)
origin2	https://git.******.com/ict/project.git (push)

//然后进行一下操作实时 //这里使用HTTPS 的话,使用 配置的 origin2 进行配置

$ git pull origin2 develop
//发现执行成功
remote: Counting objects: 22, done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 22 (delta 12), reused 0 (delta 0)
Unpacking objects: 100% (22/22), done.
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy