编译git2.19.0

环境

系统:CentOS 7

虚拟机:VMware

之前安装git是通过源安装的,版本低的可怕,才1.8。决定下载源码自己编译一个。记录一下过程。

#yum install git
git --version
#git version 1.8.3.1

首先下载源码,下载地址https://github.com/git/git/releases ,下载到你喜欢的地方。我习惯放/home下。

#cd /home
#wget https://codeload.github.com/git/git/tar.gz/v2.19.0-rc1

下载下来以后解压。

#tar -xvf git-2.19.0-rc1.tar.gz

进目录装备编译,配置下先

#cd git-2.19.0-rc1
#./configure
-bash: ./configure: No such file or directory

结果找不到目录。。。。

找了下资料,官方文档https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

需要使用make configure命令

#make configure
GIT_VERSION = 2.19.0-rc1
    GEN configure
/bin/sh: autoconf: command not found

缺少autoconf,安装一个

#yum install autoconf

再次运行make configure可以了。开始配置。

#./configure --prefix=/usr

可以开始编译了。

#make all
    * new build flags
    CC credential-store.o
In file included from credential-store.c:1:0:
cache.h:20:18: fatal error: zlib.h: No such file or directory
 #include <zlib.h>
                  ^
compilation terminated.
make: *** [credential-store.o] Error 1

发现缺少点工具,通过yum安装。

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

在次make all开始编译。

# git --version
git version 1.8.3.1

编译完成。

参考资料:

https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

https://zhuanlan.zhihu.com/p/28201948

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值