1捺典、查看已有g(shù)it版本
git --version
2、卸載低版本git
sudo yum remove git
3盖喷、依賴庫(kù)安裝
sudo?yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
sudo yum -y install? gcc perl-ExtUtils-MakeMaker
4桩撮、下載最新版git
sudo wget https://github.com/git/git/archive/v2.15.0.tar.gz
5、解壓到相應(yīng)的目錄
tar zxf git-2.15.0.tar.gz ..
6争群、安裝git
cd git-2.15.0
sudo make prefix=/usr/local/git all
sudo make prefix=/usr/local/git install
7回怜、添加到系統(tǒng)環(huán)境變量
sudo echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
sudo source /etc/bashrc
8、添加到用戶環(huán)境變量
echo "export PATH=$PATH:/usr/local/git/bin" >> /home/test/.bash_profile
source?/home/test/.bash_profile
9、查看版本號(hào)
git --version
#git version 2.15.0