centos 7 升級/安裝 git 2.7.3

一、安裝所需軟件包

# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel # yum install gcc perl-ExtUtils-MakeMaker

二、下載&安裝

# cd /usr/src # wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.gz # tar xzf git-2.7.0.tar.gz
# cd git-2.7.0 # make prefix=/usr/local/git all # make prefix=/usr/local/git install # echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc # source /etc/bashrc

三、檢查版本

# git --version

o、其餘

centos自帶Git,7.x版本自帶git 1.8.3.1(應該是,也可能不是),安裝新版本以前須要使用yun remove git卸載(安裝後卸載也能夠)。git

執行make prefix=/usr/local/git all時,可能會報錯:make: * [git-credential-store] Error 1,此時能夠使用如下命令代替centos

# ./configure --without-iconv # make CFLAGS=-liconv prefix=/usr/local/git all # make CFLAGS=-liconv prefix=/usr/local/git install
相關文章
相關標籤/搜索