在linux下安装git,通过yum方式安装的不是最新版本。
要替换最新版需要以下操作。
1.安装依赖包
# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
# yum install gcc perl-ExtUtils-MakeMaker
2.卸载旧的RPM
# yum remove git
3.下载编译git源码
可以在其他地址下载
# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-2.0.4.tar.gz
# tar xzf git-2.0..tar.gz
# cd git-2.0.
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
#
# echo 'export PATH=$PATH:/usr/local/git/bin' >> /etc/bashrc
# or
# echo 'export PATH=$PATH:/usr/local/git/bin' > /etc/profile.d/git.sh
#
# source /etc/bashrc
4.查看git版本
# git --version
git version 2.0.