之所以有这样的需求,是因为部分预安装的git版本太低,很多功能没有并且安全性存在问题。
比如git submodule add [email protected]:yyy.git必须在父repo的root目录安装,而新的版本就没有这样的限制
#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.0.4.tar.gz
# tar xzf git-2.0.4.tar.gz
# cd git-2.0.4
# 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
git version 2.0.4
时间: 2025-01-02 13:37:21