Linux 安装Git

1、取代 yum 安装的低版本 gityum remove git*2、下载最新安装包,可以去官网看看最新的是什么版本,我所处的年代是2.18.0wget https://www.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz3、 解压tar -zxvf git-2.18.0.tar.gz4、进入解压目录cd git-2.18.0(先安装这个,否则执行git clone https://..会报错)yum install curl-devel5、安装./configure --prefix=/usr/local/git-2.18.0makemake install报错(1)zlib错误yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel (2) expat.hyum install expat-devel (3)yum install perl-ExtUtils-MakeMaker(4) openssl/ssl.hyum install openssl-devel6、建立软链【Linux 安装Git】ln -s /usr/local/git-2.18.0/bin/* /usr/bin/7、查看版本git --version8、如果版本不对,把加到环境最后export PATH=/usr/local/git-2.18.0/bin:$PATH9、激活环境变量source /etc/profile 

Linux 安装Git

文章插图




    推荐阅读