1. 在git官網 (https://www.kernel.org/pub/software/scm/git/) 下載最新的git包git
2. 移除系統自帶gitbash
$ yum remove git
3. 安裝git所需依賴包curl
$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
4. 解壓git到指定目錄url
$ cd /data/ $ tar -xzvf git-2.9.3.tar.gz
5. 配置安裝路徑code
$ cd git/ $ ./configure --prefix=/usr/bin/git
6. 編譯ssl
$ make $ make install
7. 軟鏈接到/usr/local/bin/gitrem
$ ln -s /usr/bin/git/bin/git /usr/local/bin/git
8. 查看git版本get
$ git --version