git安裝--linux下的安裝


一般linux自帶git版本很舊,會有一定問題,可以先卸載系統自帶git:

yum remove git
下載及安裝git:

wget https://github.com/git/git/archive/v2.2.1.tar.gz
tar zxvf v2.2.1.tar.gz
cd git-2.2.1
make configure
./configure --prefix=/usr/local/git/ --with-iconv=/usr/local/libiconv --with-curl=/home/{username}/curl/
make
make install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

配置curl很重要。 
可能出現的問題,少一些系統庫: 
1.編譯git時報錯: zlib.h: No such file or directory
缺少 zlib的頭文件, 開發包沒裝,

yum install zlib (系統默認已經裝上)
yum install zlib-devel

解決

2.提示make cc Command not found

yum install gcc
3.make[1]: * [perl.mak] Error 2 make: * [perl/perl.mak] Error 2
執行:

yum install perl-ExtUtils-MakeMaker package.
進行安裝 
出現錯誤二: 
/bin/sh: msgfmt: command not found

yum install gettext-devel
可解決!

4./bin/sh: line 1: asciidoc: command not found
安裝asciidoc: 
到官網下載asciidoc 
http://www.methods.co.nz/asciidoc/index.html 
http://sourceforge.net/projects/asciidoc/

cp asciidoc-8.5.2.tar.gz /root/src
cd /root/src
tar xvfz asciidoc-8.5.2.tar.gz
cd asciidoc-8.5.2
./configure
sudo make install
5./bin/sh: line 1: xmlto: command not found

yum install xmlto
6.如果出現http/https異常,安裝curl


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM