您的位置:首页 > 运维架构 > Linux

CentOS下安装Git2.9

2017-11-29 16:29 225 查看
CentOS6.5自带的git版本是1.7.1

卸载自带的git

# yum remove git

下载最新版git

# wget https://github.com/git/git/archive/v2.9.2.tar.gz[/code] 解压

# tar zxvf v2.9.2.tar.gz
# cd git-2.9.2

编译安装

# make configure
# ./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
# make all doc
# sudo make install install-doc install-html


修改环境变量

# sudo vim /etc/profile


在最后一行添加

export PATH=/usr/local/git/bin:$PATH

保存后使其立即生效

# source /etc/profile


查看是否安装成功

#git --version


参考文章:flyxuan
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: