linux centos7.6更新git版本
//
#!/bin/bash # Your Answer # filename: gitrefresh.sh # chmod u+x gitrefresh.sh # ./gitrefresh.sh sudo yum remove git -y rm -rf /usr/local/git mkdir /usr/local/git cd /usr/local/git # 安装依赖库 yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel -y yum install gcc perl-ExtUtils-MakeMaker -y wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz # cp /home/git-2.9.5.tar.gz /usr/local/git tar -zxvf git-2.9.5.tar.gz cd git-2.9.5 ./configure --prefix=/usr/local/git make && make install echo 'export PATH=/usr/local/git/bin:$PATH' >> /etc/profile # 生效环境变量 source /etc/profile git --version
//