Linux在线安装git(亲测成功)

一、先检测是否已安装

  安装git需要安装一些依赖,但是安装依赖之前需要先检测一下是否已经安装了git。

rpm -qa | grep zlib-devel 

二、具体安装命令

如果以前没有安装过,则下载下列依赖(需要联网)

# yum -y install zlib-devel openssl-devel perl cpio expat-devel gettext-devel 
# yum install curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
# yum install autoconf 
# wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.gz 
# chmod +x git-2.7.3.tar.gz 
# tar xzvf git-2.7.3.tar.gz 
# cd git-2.7.3 
# autoconf 
# ./configure --with-curl=/opt/git 
# make 
# make install 

三、测试

git version

 

posted @ 2016-03-16 10:47  liurio  阅读(569)  评论(0编辑  收藏  举报