linux安装git

1、安装git

git --version

-bash: git: command not found

cent os6.9 yum 源已经带有yum

yum -y install git

安装完成 查看版本 git --verion

git version 1.7.1

Github等需要的Git版本最低都不能低于1.7.2

2、升级Git

安装依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
yum install  gcc perl-ExtUtils-MakeMaker 

卸载git 
git --version
yum remove git

编译安装最新git
git客户端: https://mirrors.edge.kernel.org/pub/software/scm/git/
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.3.tar.gz
tar -xvf git-2.9.3.tar.gz
cd git-2.9.1
make prefix=/usr/local/git all
make prefix=/usr/local/git install

echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
source /etc/profile

git --verision

参考 :https://cloud.tencent.com/developer/article/1027571

你可能感兴趣的:(git,Linux)