centos7安装git
1.安装git依赖包
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
2.删除已有的git
yum remove git
3.下载git
在usr/src目录下
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz
解压
tar -zxvf git-2.8.3.tar.gz
进入git-2.8.3目录,配置git安装路径
./configure prefix=/usr/local/git/
编译并安装
make && make install
4.将git指令添加到bashrc中
vi ~/.bashrc
在最后一行添加
export PATH=$PATH:/usr/local/git/bin
让配置立即生效
source ~/.bashrc
由于升级了git版本,git clone的时候报了如下错误
fatal: unable to access 'https://github.com/google/glog.git/': SSL connect error
可靠的解决办法
yum update -y nss curl libcurl