Linux安装配置Git
首先查看是否安装git
git --version
1.我使用的是contos,在线安装代码为:
sudo yum install git
2.在线安装的版本都比较老,还可以自己手动安装
(1)首先安装依赖包
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
(2)下载git包
wget https://www.kernel.org/pub/software/scm/git/git-2.9.4.tar.gz
(3)解压git包并进入目录
tar -zxvf git-2.9.4.tar.gz
cd git-2.9.4.tar.gz
(4)编译并安装
make prefix=/usr/local/git all
make prefix=/usr/local/git install
(5)配置环境变量
sudo vim /etc/profile
再末尾加上path
export PATH=/usr/local/git/bin:$PATH
执行应用修改
source /etc/profile
(6)再次查询版本即可
git --version