赞
踩
fatal: unable to access 'https://github.com/xxxx/xxxx.git': Failed to connect to 127.0.0.1 port 8087: Connection refused
将“git clone https://github.com/Z3Prover/z3.git”中的“https”更换为“git”。即为“git clone git://github.com/Z3Prover/z3.git”。这种方法最为简单有效,如过还是报错可尝试第二种方法。亲测有效
可以尝试这位博主的两种方案,这两种方法都没有解决我的问题,你们可以试一下,有人说可以解决。转自:https://blog.csdn.net/dashi_lu/article/details/89641778
1. 安装git
sudo apt-get install git
- 1
2. 配置用户信息
$ git config -- global user. name "Your Name" $ git config -- global user. email Your_email @example. com
- 1
3. 初始化本地仓库设置
git init
- 1
通过ssh连接GitHub
1. 安装ssh
sudo apt-get install ssh
- 1
ssh-keygen 会确认密钥的存储位置和文件名(默认是 .ssh/id_rsa),然后他会要求你输入两次密钥口令,留空即可。所以一般选用默认,全部回车即可。 如下图所示
2. 创建秘钥文件
ssh-keygen -t rsa -C "你的github账号邮箱"
- 1
3. 将公钥添加到GitHub账户
(1)将
id_rsa.pub
文件内容全部复制;(2)登陆到GitHub上,右上角小头像->Setting->SSH and GPG keys中,点击new SSH key。
4. ssh测试
ssh -T git@github.com
- 1
结果为:
,表示配置成功。
4. 使用 git clone https://github.com/Z3Prover/z3.git,测试是否真的成功?
在我的机器上又报了如下错误:
5. 原因是你的git buffer太低了。为解决上述报错,需要执行:
git config --global http.postBuffer 50M
- 1
再次执行 git clone https://github.com/Z3Prover/z3.git。结果如下:
已经可以成功clone项目了。
总结:问题很小,但是解决问题的方案很多,我只是将这几种方法总结到了一起,如果其他问题,欢迎一起讨论,也欢迎批评指正。谢谢大家
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。