iOS 进阶文集github sshiOS Developer

Git克隆提交出现“ssh: connect to host g

2017-01-10  本文已影响88人  繁华落尽丶lee

问题

没有一点点防备,也没有一丝顾虑,
你就这样出现,在我的世界里,
带给我惊喜,情不自己

克隆,提交代码是出现问题:

error.log

分析:输出信息prot 22: Operation timed out,初步分析端口问题我们修改端口试试,这里将端口改为443

解决方法

在存放私钥公钥(id_rsa和id_rsa.pub)文件里,新建config文本。命令vim ~/.ssh/config,输入一下内容:

Host github.com
User YourEmail@163.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

:wq保存退出。
目前,还不能使用,需要最后设置config

git config --global user.name "XXX"
git config --global user.email XXX@xx.com

这个操作就是为了刷新config,使修改生效。
现在克隆或者提交代码试试吧!

问题

当向远程仓库push代码时出现该错误。

error: unpack failed: error Missing blob c7eb8a2bcbe57f7f134819fbe6e2975b04b2e548

出现该问题是因为本地索引出错导致的,解决方法很简单。

* 第一步:切换到其他branch。例如:git checkout dev 
* 第二步:来取远程数据。命令:git pull origin dev
* 第三步:切换到之前的branch再push。
上一篇 下一篇

猜你喜欢

热点阅读