# 编译安装Git
> 通过编译安装方式安装Git、机器为Fedora。
1. 安装前先解决依赖问题
```bash
sudo yum install curl curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl perl-devel asciidoc xmlto docbook2x
```
2. 下载git源文件,这里以git-2.15.0.tar.gz 为例,下载地址:[https://mirrors.edge.kernel.org/pub/software/scm/git/](https://mirrors.edge.kernel.org/pub/software/scm/git/)
3. 解压文件
```bash
tar -zvxf git-2.15.0.tar.gz
```
4. 进入解压目录 执行编译安装
```bash
make configure
./configure --prefix=/usr/local/git
make all doc info
sudo make install install-doc install-html install-info
```
**借鉴** : [pro git](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git)