Write the Code. Change the World.

4月 04

linux在安装一些服务的时候,可能安装了 git,不过那 git 的版本太旧了。所以想安装个最新的。

卸载以前旧的版本

rpm -q git
# git-1.8.3.1-12.el7_4.x86_64
rpm -e --nodeps git-1.8.3.1-12.el7_4.x86_64

下载安装 git

git 官网:https://git-scm.com/ , 当前最新版本是 2.9.5

cd /usr/local/src/

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

tar -xzvf git-2.9.5.tar.gz 

cd git-2.9.5

./configure prefix=/usr/bin/git/ # 配置,设置安装目录

make && make install

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注