首页 笔记 图片 查字 
所属分类:Linux
浏览:120
内容:

Github下载网址:

https://github.com/git/git

https://github.com/git/git/tags


安装指定git客户端版本的过程

git-2.36.0


[root@localhost]#  wget https://github.com/git/git/archive/refs/tags/v2.36.0.tar.gz

[root@localhost]#  tar -zxvf v2.17.0.tar.gz  


安装依赖

[root@localhost]#  yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker


安装依赖时候会自动安装git比较老的版本,所以删除git老版本

[root@localhost]#  yum remove git


编译源码

[root@localhost]#  cd git-2.36.0

[root@localhost]#  make prefix=/usr/local/git all 

[root@localhost]#  make prefix=/usr/local/git install 


配置环境变量

[root@localhost]#  vim /etc/profile

[root@localhost]#  PATH=$PATH:/usr/local/git/bin

[root@localhost]#  source /etc/profile


检查是否安装成功

[root@localhost]#  git --version

[root@localhost]#  git version 2.36.0

[root@localhost]#