天天看點

Centos6.5中安裝git2.1.2

# 安裝必須檔案

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

yum install  gcc perl-ExtUtils-MakeMaker

# 下載下傳git源代碼

wget --no-check-certificate https://www.kernel.org/pub/software/scm/git/git-2.1.2.tar.gz

# 解壓并安裝

tar xzf git-2.1.2.tar.gz

cd git-2.1.2

make prefix=/usr/local/git all

make prefix=/usr/local/git install

# 設定環境變量

echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc

source /etc/bashrc

# 測試

git --version