# centOS7.6下安裝git yum remove git # 刪除centOS7自帶git版本 cd / wget https://www.kernel.org/pub/software/scm/git/git-2.13.3.tar.gz # 下載git-2.13.3 tar -zxvf git-2.13.3.tar.gz # 解壓 cd git-2.13.3 # 安裝依賴包 yum -y groupinstall "Development Tools" yum -y install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel ./configure --prefix=/usr/local/git2 # 配置安裝路徑 make make install cd /usr/bin && rm -rf git # 刪除舊軟連接 ln -s /usr/local/git2/bin/git /usr/bin/git # 添加新軟連接 cd / && git --version # 安裝完成,查看當前git版本