Centos 安装 git

1:下载git

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.1.tar.gz

2:解压

tar -zxvf git-2.30.1.tar.gz

3:进入文件夹

cd git-2.30.1

4:安装所需依赖

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker

5:编译

make prefix=/usr/local/git all

6:安装

make prefix=/usr/local/git install

7:修改环境变量

  • vi /etc/profile
  • 最下面加上:
    export PATH=$PATH:/usr/local/git/bin
  • 刷新环境变量
    source /etc/profile

 8:检查

git --version

你可能感兴趣的:(linux系统,git,github,运维)