linux为centos
1.下载git 包
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
2.减压包
tar -zxf git-2.9.5.tar.gz
3.下载git依赖 通过yum来安装
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
4.git根目录下执行
./configure --prefix=/usr/local/git
5.编译和安装
make && make install
6.配置环境变量
vim /etc/profile
GIT_HOME
GIT_HOME=/usr/local/git
export PATH=GIT_HOME/bin
刷新
source /etc/profile
网友评论