解决github上http克隆代码问题(SSH方式)centos

常见报错如下:

fatal: unable to access 'https://github.com/cnych/demo_service/': Failed connect to 127.0.0.1:1080; Connection refused

代理问题报错

fatal: unable to access 'https://github.com/cnych/emo_service/': TCP connection reset by peer

https方式克隆报错

fatal: unable to access 'https://github.com/cnych/demo_service/': Empty reply from server

处理方式如下(亲测有效) 

用户以及邮箱配置

# 创建全局名称
 git config --global user.name 'wangdada'
 # 创建email
 git config --global user.email "[email protected]"

查看一下git的配置是否已经有了

git config --global -l

 

配置ssh免密登录

ssh-keygen  -t rsa -C "你的邮箱"

一直点回车就可以

生成公私钥

将公钥复制下来登录github

打开github 

 解决github上http克隆代码问题(SSH方式)centos_第1张图片

解决github上http克隆代码问题(SSH方式)centos_第2张图片

 将公钥复制到这里

可以进行ssh -T进行测试

找到你要克隆的项目

解决github上http克隆代码问题(SSH方式)centos_第3张图片

 

git clone [email protected]:xxxxxxxxxxxxxxxxxx

 

你可能感兴趣的:(Github,github,centos,ssh,网络协议)