安裝git是由於vue-cli須要git去下載webpack這樣的模板vue
1, 安裝編譯git時須要的包webpack
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker
2, 刪除已有的git .
yum remove git
3, 下載git源碼.git
wget https://github.com/git/git/archive/v2.13.0.tar.gzgithub
tar zxvf v2.13.0.tar.gzweb
咱們能夠從https://github.com/HYPERLINK "http://lib.csdn.net/base/git" \o "Git知識庫" \t "_blank"Git/git/releases 查看最新版的,而後把wget後面的版本換成最新的vue-cli
4, 編譯安裝bash
cd git-2.13.0make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc
PS:make prefix=/usr/local/git all這一步可能會報錯如:Can't locate ExtUtils/MakeMaker.pm in @INC….解決方案:yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker 而後再從新執行make prefix=/usr/local/git all
5, 檢查一下版本號
git --version