centos7安装git
Posted mowen120
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7安装git相关的知识,希望对你有一定的参考价值。
在https://mirrors.edge.kernel.org/pub/software/scm/git/中找自己需要的版本gz包,复制资源链接地址
下载
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.25.0.tar.gz
解压
tar -zxf git-2.9.5.tar.gz
编译和安装
进入文件夹 cd git-2.9.5/
安装c编译器 yum -y install gcc
安装autoconf yum -y install autoconf
安装 yum -y install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
配置目录: ./configure --prefix=/usr/local/software/git
执行 make profix=/usr/local/software/git
执行 make install 进行安装
配置环境变量:
vim /etc/profile
添加
#set git environment
export PATH=$PATH:/usr/local/software/git/bin
让环境生效 source /etc/profile
用 git --version 检查
以上是关于centos7安装git的主要内容,如果未能解决你的问题,请参考以下文章