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
- 安装依赖
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc -y
sudo yum install gcc perl-ExtUtils-MakeMaker -y
- 下载git安装包
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.28.0.tar.gz
- 解压安装
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 成功