git clone 失败
报错: TCP connection reset by peer

[lj@localhost ~]$ git clone http://github.com/diem/diem.git && cd diem
正克隆到 'diem'...
fatal: unable to access 'http://github.com/diem/diem.git/': TCP connection reset by peer
[lj@localhost ~]$ git clone https://github.com/diem/diem.git && cd diem
正克隆到 'diem'...
fatal: unable to access 'https://github.com/diem/diem.git/': Failed connect to github.com:443; Connection refused
[lj@localhost ~]$ git --version
git version 1.8.3.1
[lj@localhost ~]$ sudo yum remove git

解决办法:
卸载老版本git

sudo yum remove git

安装新版本git

  1. 安装依赖
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc -y
sudo yum install  gcc perl-ExtUtils-MakeMaker -y
  1. 下载git安装包
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.28.0.tar.gz
  1. 解压安装
tar -zxf git-2.28.0.tar.gz
mkdir -p ~/local/git 
cd git-2.28.0/
./configure --prefix=$HOME/local/git
make && make install

4.设置环境变量

export PATH=$HOME/local/git/bin:$PATH
#查看git版本
git version
[lj@localhost git-2.28.0]$ git version
git version 2.28.0

再次git clone 成功
在这里插入图片描述

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐