git#002#编译安装指南

从上文可知,目前已知有两处源代码下载地址,代码稍微不同,我们分别使用不同的源代码包进行编译安装。方法如下所述。

安装依赖项

1
2
$ sudo apt install zlib1g-dev
$ sudo apt install gettext

源代码编译(1)

使用如下命令进行编译安装:
下载地址:https://cdn.kernel.org/pub/software/scm/git
下载举例:https://cdn.kernel.org/pub/software/scm/git/git-2.43.0.tar.gz

1
2
3
4
5
6
7
8
$ wget https://cdn.kernel.org/pub/software/scm/git/git-2.43.0.tar.gz
$
$ tar -zxvf it-2.43.0.tar.gz
$ cd git-2.43.0
$
$ ./configure --prefix=/home/mancode/apps/git/git-2.43.0
$ make
$ make install

源代码编译(2)

使用如下命令进行编译安装:
下载地址:https://github.com/git/git/tags
下载举例:https://github.com/git/git/archive/refs/tags/v2.43.0.tar.gz

1
2
3
4
5
6
7
8
9
10
$ wget https://github.com/git/git/archive/refs/tags/v2.43.0.tar.gz
$
$ tar -zxvf it-2.43.0.tar.gz
$ cd git-2.43.0
$
$ autoreconf
$
$ ./configure --prefix=/home/mancode/apps/git/git-2.43.0
$ make
$ make install