CentOS 最新版本git的安装教程


CentOS7自带的git版本是1.8.3
1.卸载自带的git
# yum remove git
2.下载最新版git
# cd /usr/src
# wget https://github.com/git/git/archive/v2.16.1.tar.gz
3.解压
# tar zxvf v2.16.1.tar.gz
# cd git-2.16.1
4.编译安装
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
4.1如果报错
# ./configure --without-iconv
# make CFLAGS=-liconv prefix=/usr/local/git all
# make CFLAGS=-liconv prefix=/usr/local/git install
5.修改环境变量
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc
6.查看当前版本
# git --version

声明:祁志飞||小祁的博客|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - CentOS 最新版本git的安装教程


QQ:137867590