源码部署Git🍄


源码安装Git🍄


 

git官网下载最新版本GIT:   

https://mirrors.edge.kernel.org/pub/software/scm/git/

[root@localhost ~]# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.43.0.tar.xz

1.安装依赖包:

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

注意:安装依赖时,yum自动安装了Git,需要卸载旧版本Git,命令为:

[root@localhost ~]# yum remove git

2.安装git:

 

[root@localhost ~]# tar -xvf git-2.43.0.tar.xz -C /usr/local/
[root@localhost ~]# cd /usr/local/git-2.43.0/

编译配置

[root@localhost git-2.43.0]# ./configure prefix=/usr/local/git
[root@localhost git-2.43.0]# make && make install

3.修改环境变量:

[root@localhost ~]# vim /etc/profile
export PATH=$PATH:/usr/local/git/bin
[root@localhost ~]# source /etc/profile

4.测试是否安装成功:

[root@localhost ~]# git --version
git version 2.43.0

 



posted @ 2020-07-29 09:58  Noleaf  阅读(213)  评论(0编辑  收藏  举报